40

I can't find a way to upgrade all NuGet packages at one time like you can in Visual Studio 2013.

I only see how to do it one by one.

Anyone know how do upgrade all at one time?

1
  • 4
    As far as I no you can not yet do this through the GUI, you will have to use the Package Manager Console for now. VS15 is pretty smooth, the new NuGet Manager not (yet) so.
    – Saragis
    Jul 28, 2015 at 22:57

4 Answers 4

44

Open the Package Manager Console and use the Update-Package cmd-let to update all packages.

5
  • was looking for way through the GUI like VS2013, but this will work, thx!
    – AZ Chad
    Jul 30, 2015 at 16:25
  • Thanks. But how to make it for the whole solution ? Aug 4, 2015 at 6:15
  • 6
    Is there a way to filter via a different feed source? For example, in VS 2013, you could select a particular source and choose "Update All". (We have a local NuGet feed that makes this particularly handy.) We have tried using update-package with the "-Source" switch, but this tries to update every single package (instead of only those that are actually in the local feed). Btw, according to the NuGet blog (blog.nuget.org/20141112/nuget-3.0-preview.html), they plan on this in the GUI...I hope they will hold to that!
    – user4275029
    Aug 11, 2015 at 14:38
  • @WahidBitar See my answer below for updting the entire solution in one command.
    – MikeJansen
    Sep 10, 2015 at 12:17
  • Tools > NuGet Package Manager > Package Manager Console (Alt + T N O)
    – JDNickell
    Mar 20, 2016 at 16:21
23

From Package Manager Console:

foreach ($p in get-project -all) { update-package -ProjectName $p.ProjectName }
3
  • THIS IS THE RIGHT ANSWER!
    – Mr. B
    May 24, 2017 at 16:36
  • And BTW, what the hell Microsoft, just give us a button that does this!
    – Mr. B
    May 24, 2017 at 16:36
  • I get error with your code in VS2019 Preview: update-package : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services. It looks like exception occurs race-condition--like in random loop iterations. Retrying the same command until no exception occurs allows to be sure that all packages updated.
    – Vinigas
    Nov 5, 2019 at 13:50
6

In VS2017, you can do the following:

  1. Right click a solution -> Manage NuGet Packages for solution. Ensure that the appropriate package source is selected if you're looking for packages only from a specific source
  2. Click on the "Updates" tab enter image description here
  3. Check the boxes next to packages you wish to update and click the "Update" button
1
  • The problem with this method is, that sometimes the page just remains blank (and you have to close all instances of Visual Studio and start over).
    – gimlichael
    Mar 31, 2019 at 9:31
2

You could write a custom script for updating the packages like the following and execute it in the package manager console

$list = Get-package -project {Add project name here}
for($i=0; $i -lt $list.Length;$i ++ ) { Update-Package -project {Add project name here} $list[$i].Id } 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.