Tip: Force-reinstall NuGet packages

NuGet is a great package manager, but sometimes it misbehaves and packages are either not properly downloaded or are not properly included in your project. Whenever you come across this, I recommend doing a force-reinstall of all packages.

In Visual Studio go to Tools -> NuGet Package Manager -> Package Management Console . In the Package Manager Console window then enter the following command:

Update-Package -reinstall

This will go package by package and force-reinstall them the opened solution.

If you want to force-reinstall packages only for one specific project instead of the whole solution, you can add the -ProjectName switch:

Update-Package -reinstall -ProjectName <yourproject>

NuGet

Buy me a coffeeBuy me a coffee

1 thought on “Tip: Force-reinstall NuGet packages”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.