Visual Studio - How to reinstall a Nuget package using commandline

If you are trying to uninstall a Nuget package just to reinstall it, you might end up in a dependency hell if other packages depend on it. You could of course ignore dependencies when uninstalling and then install it again. In this case the reinstall parameter is very handy, you can use this in the "package manager console". A simple command with the -reinstall parameter will do the trick:

Update-Package <package-name> -Reinstall

This will also help you fix DLL references or install files you might have deleted from the package installation. This will simply reinstall the package as if it is installed for the first time. I have used this often when working with .Net Framework.

I also wrote a post on how to update multiple nuget packages starting with the same name.

If you found this helpful, please leave a comment down below!