Switching program from .Net 4.0 to 4.5

If, like me, you switched your .Net program from 4.0 to 4.5, you might have encountered a bunch of problems.

What worked for me is the following.

First, modify your projects to use .Net 4.5. Make sure it builds (even if you might get a bunch of errors). Save and commit.

Next, run the following command in the VS package manager console:

This should reinstall your Nuget packages without touching their dependencies.

If you still get MSB3277 errors (“Found conflicts between different versions of the same dependent assembly that could not be resolved”), follow these steps:

  • In Visual Studio, open tools > options > projects and solutions > build and run > select “detailed” for the two msbuild output options.
  • Build your project
  • In the “output” window, search for MSB3277. Go up a little bit, and look for “A conflict exists between…”. It will tell you which assembly is conflicted.

Myself, it was the System assembly… weird.

The both most simple, and most annoying solution, is to remove all references and Nuget packages, then add them back.