87

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.

4
  • Did anything change when this started happening? Does it happen for all projects and framework versions?
    – SLaks
    Apr 24, 2011 at 2:02
  • @SLaks Not that I'm aware of. Yes. Apr 24, 2011 at 2:05
  • In my case, there was some update installed by admin team. After installation, I got similar error. I restarted Visual Studio. Error was resolved and I could debug.
    – Sarang
    Dec 9, 2016 at 7:01
  • Also this error can occur on VS2015.
    – Dib
    Jun 7, 2017 at 12:58

11 Answers 11

175

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.

8
  • 1
    +1 - I had the same error, but when trying to attach to a process. My computer had failed installing some updates, and was pending a reboot. After rebooting and retrying the updates, I can attach again.
    – Paul
    Jul 11, 2011 at 18:21
  • 4
    My computer is in the process of running updates, which could be related. Though in my case simply closing and reopening VS 2010 fixed the problem.
    – TTT
    Aug 18, 2011 at 18:09
  • 1
    On VS 2012 SP 1, after a .net framework update, I had this error. Restarting only IIS Express for application (the one from VS) also solved the issue without having to reboot the computer. Feb 8, 2013 at 12:20
  • 4
    Sometimes I really hate Microsoft.
    – user153923
    Jun 4, 2013 at 19:51
  • 2
    I also got this error when using Windows update, but could run my solution just fine after restarting Visual Studio (2010). I didn't need to restart the computer or complete the updating procedure beforehand either.
    – Sheridan
    Jul 11, 2013 at 8:37
6

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.

4

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.

1
  • +1 I had pending updates. Everything worked after restarting computer. Visual Studio 2013 on Windows 7. Feb 12, 2014 at 15:11
4

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

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

3

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!

3

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.

1
  • 1
    dead link? seems dead to me.
    – DATEx2
    Jul 28, 2015 at 14:00
2

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

1

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.

1

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

1

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.

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.