C# – Targeted the project in Visual 2010 to .Net 4.0 but the system still looks for the dll ‘System.Core version 2.0.5.0’

cdllvisual studio 2010wpf

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.

Best Answer

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.