Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Targeted my project in Visual 2010 to .Net 4.0 but the system still looks for the dll 'System.Core version 2.0.5.0'

My project targets .Net 4.0 Client profile but it crashes as soon as it starts by displaying a file load exception stating that System.Core version= 2.0.5.0 . How can I change that?

Edit: Forgot to add, it's a WPF project.

like image 981
Ammark Avatar asked Feb 09 '12 22:02

Ammark


People also ask

What is the MSCorLib DLL?

NET Framework, MSCorLib. dll was an acronym for Microsoft Common Object Runtime Library. Once ECMA started to standardize the CLR and parts of the FCL, MSCorLib. dll officially became the acronym for Multilanguage Standard Common Object Runtime Library."


2 Answers

This is mainly for future me, who will at some point come back to this question, and none of the current answers will solve your problem (hey future me!)

My issue was a nuget package referencing System.Core 2.0.5.0 so I had no control over the reference.

To get System.Core 2.0.5.0 installed on the machine, which already had .NET 4.0 installed and patched, I installed the Portable Class Library.

To install the Portable Class Library tools on a build machine without installing Visual Studio 2012, download the Portable Library Tools, and save the download file (PortableLibraryTools.exe) on your computer. Run the installation program from a Command Prompt window, and include the /buildmachine switch on the command line.

like image 146
Cameron MacFarland Avatar answered Sep 28 '22 18:09

Cameron MacFarland


I had a problem similar to this that only occurred on windows XP/Server 2003 while Windows 7/Server 2008 and later worked fine. After a long time of looking I ran into this article:

http://code.google.com/p/autofac/wiki/FrequentlyAskedQuestions

It suggested downloading the following hotfix

http://support.microsoft.com/kb/2468871

After installing that everything worked fine! Maybe give that a try and see if it helps.

like image 27
Hagelt18 Avatar answered Sep 28 '22 19:09

Hagelt18