The version of clr.dll does not match the one mscordacwks.dll was built for

Visual Studio

Visual Studio Problem Overview


I have a C# console app in Visual Studio 2010 that I can run just fine. When I attempt to run the process in debug mode, I am presented with the following error:

clr.dll version doesn't match mscordacwks.dll

I have tried searching for any information, but I haven't been able to find anything. Can anyone provide clues as to why I can't run this with the debugger?

EDIT: I should clarify that I have been able to successfully debug a console app previously, this is a new situation.

Visual Studio Solutions


Solution 1 - Visual Studio

From what I can tell when I'm able to reproduce this error, it is caused by being in the middle of installing Windows updates. So, running updates, then postponing a reboot, then attempting to debug code is what was putting me in this broken state.

Solution 2 - Visual Studio

I had this issue once and it was caused by an pending Windows Update on the Server where the process was running, which I wanted to attach.

Solution 3 - Visual Studio

I encountered the same issue. It happened to me when I attempted to attach to a process for debugging purposes. At the time I had postponed a pending windows update.

Everything started working fine after I restarted my computer and allowed the update to take place.

Additional notes: I had recently updated to Visual Studio 2010 Ultimate and installed its Service Pack 1.

Solution 4 - Visual Studio

I had this when I installed .NET 4.6 for Visual Studio 2013.

In this particular case, restarting Visual Studio 2013 solved the problem.

Solution 5 - Visual Studio

I have finally solved this!

It seemed to have happened after I updated my Windows 7. One of my files must have been out of date.

The fix: Install VS 2010 Service Pack 1

Worked correctly right after I installed. Hitting breakpoints and everything!

Hope this works for you too!

Solution 6 - Visual Studio

I also updated to Service Pack 1, and made sure Windows updates were up to date, but I was still having the same issue:

> "The Version of CLR.dll in the target does not match the one mscordacwks.dll was built for."

Microsoft closed this issue on connect.microsoft.com as not reproducible... Unforgivable, irresponsible support system!!

But on social.msdn.com I was directed to upgrade through this link, and this has resolved the problem in my machine ( Win7,VS2010,target 4.0)

Hope it helps.

Solution 7 - Visual Studio

Simply. Restarting Visual Studio solved the problem in my case.

Solution 8 - Visual Studio

I had VS 2010 SP1 for ages and had rebooted many times. There wasn't any windows update in progress either. I closed all my VS 2010 IDEs and then opened them, and the problem was gone.

Solution 9 - Visual Studio

This happens, when you do a WINDOWS UPDATE and haven't rebooted your system and the update isn't compatible with VISUAL STUDIO. So in order to solve this, just do an update on VISUAL STUDIO to latest. That should FIX it

Solution 10 - Visual Studio

I had this weird issue after installing .net framework 4.5, when using .net 4 for my project. updating VS 2010 service pack didn't solve this, only removal of .net 4.5 and 4, and then reinstalling .net 4 only.

Solution 11 - Visual Studio

I have VS2013 on Win7 and restarting VS worked for me. Seems it is a VS/CLR bug.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRebecca ChernoffView Question on Stackoverflow
Solution 1 - Visual StudioRebecca ChernoffView Answer on Stackoverflow
Solution 2 - Visual StudioChrisView Answer on Stackoverflow
Solution 3 - Visual StudioJeremy Ray BrownView Answer on Stackoverflow
Solution 4 - Visual StudioContangoView Answer on Stackoverflow
Solution 5 - Visual StudiosharpperView Answer on Stackoverflow
Solution 6 - Visual StudioHydPhaniView Answer on Stackoverflow
Solution 7 - Visual StudioManish DubeyView Answer on Stackoverflow
Solution 8 - Visual StudioFarhanView Answer on Stackoverflow
Solution 9 - Visual StudioManJanView Answer on Stackoverflow
Solution 10 - Visual StudioIdoTView Answer on Stackoverflow
Solution 11 - Visual StudioNir MaozView Answer on Stackoverflow