I have migrated a solution that is currently targeting .NET 4.0 in VS2010 to VS2012 and now I would like to re-target it to .Net 4.5
What I am not sure about is the NuGet packages. For example EF5, which I updated from EF4 in VS2010 turns out to be actually EF 4.4 as you can see here:
<Reference Include="EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll</HintPath>
</Reference>
I can also see the following in packages.config for the project:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="5.0.0" targetFramework="net40" />
</packages>
So my question is:
What is the best practice to re-target all NuGet packages that are currently set to target .NET 4.0 to target .NET 4.5?
NuGet 2.1 offers a feature that makes this a lot simpler: just do update-package -reinstall -ignoreDependencies
from the Package Manager Console.
NuGet 2.0 doesn't handle re-targeting your applications very well. In order to change your packages' target frameworks, you must uninstall and reinstall the packages (taking note of the packages you had installed so that you can reinstall each of them).
The reason packages must be uninstalled and reinstalled is: