Dll 的版本与 mscodacks.dll 的构建目标版本不匹配

我在 Visual Studio 2010中有一个 C # 控制台应用程序,我可以很好地运行它。当我尝试在调试模式下运行该进程时,会出现以下错误:

clr.dll version doesn't match mscordacwks.dll

我试过搜索任何信息,但是一无所获。有没有人能提供一些线索,解释为什么我不能用调试器运行它?

编辑: 我应该澄清,我已经能够成功地调试一个控制台应用程序以前,这是一个新的情况。

27133 次浏览

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!

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.

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.

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.

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.

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

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.

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.

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

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

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

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