How to fix NuGet packages when upgrading .NET Framework

How to fix NuGet packages when upgrading .NET Framework

If you find yourself in the middle of upgrading the .NET Framework on your project, you may have encountered some errors letting you know that the project's associated NuGet packages need to be re-installed.

Have no fear, you are almost done with your upgrade. Long gone are the days of having to manually go through your entire project uninstalling the packages yourself. With NuGet 2.1+, this becomes trivial.

In Package Manager (View -> Other Windows -> Package Manager) type:

update-package -reinstall

This command will uninstall all NuGet packages in your entire solution and re-install them targeting the correct .NET framework.

Happy solution upgrading.

Robert Greiner

Robert Greiner

Professional optimist. Passionate about cultivating high-performing teams @ scale by integrating the timeless wisdom of the past with the marvel of today's emergent technology in a practical way.

View Comments
Next Post

Missing Nuget Packages on TFS Build Server

Previous Post

Board Games Improve Leadership and Decision Making Skills

Subscribe for free

Subscribe to my newsletter and get the latest posts delivered right to your inbox for free. I don't spam and your email won't be shared with third-parties.

Thanks for subscribing!

Check your inbox to confirm your subscription.

Please enter a valid email address!