How do I (re)install all NuGet packages from the Package Manager Console? Use the Update-Package cmdlet

Posted: (EET/GMT+2)

 

Today's blog post is a quick reminder on how to use the Budget Package Manager Console (PMC) to restore all NuGet packages for a .NET project or solution. To do this, simply run the cmdlet Update-Package to restore all packages.

Sometimes, you also need to restore all assembly references to your NuGet packages. You can do this also with the Update-Package command: just add the -Reinstall parameter as follows:

Update-Package -Reinstall

This cmdlet is useful in itself, but also as a troubleshooting solution when normal, automatic package restore fails. In these situations, Visual Studio doesn't always provide you with good information about the error, so using the PMC version give you a better chance in figuring out what went wrong.