Reinstall nuget packages in project – command

Ever been in a situation where you wanted to have all nuget packages of a project to be kind of “refreshed”?

I had the other day, I upgraded a project from .NET 3.5 to .NET 4.0 and therefore needed to get the nuget packages for the particular .NET version. I didn’t wanted to reinstall all the packages manually because there were actually a lot.

Therefore I Googled with Bing and found the following command, which did the trick.

Update-Package –reinstall -project MySuperProject.Web

  • Michal Hainc

    Perfect, thank you, helped me a lot!

  • Good to hear :)
    I use this article myself a lot, as I keep forgetting the command :D

  • Jais Edelmann

    YESS! Nifty comand :)

  • Yes! Used myself many times since I wrote it :)