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?
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?
Open the Package Manager Console and use the Update-Package
cmd-let to update all packages.
From Package Manager Console:
foreach ($p in get-project -all) { update-package -ProjectName $p.ProjectName }
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.
In VS2017, you can do the following:
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 }