Is there a way to upgrade all NuGet packages at one time in Visual Studio 2015?

时间:2015-07-28 22:29:49

标签: nuget visual-studio-2015

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?

3 个答案:

答案 0 :(得分:40)

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

答案 1 :(得分:3)

在VS2017中,您可以执行以下操作:

  1. 右键单击解决方案 - >管理NuGet包以获得解决方案。如果您只查找来自特定来源的软件包,请确保选择了相应的软件包源
  2. 点击“更新”标签 enter image description here
  3. 选中要更新的软件包旁边的框,然后单击“更新”按钮

答案 2 :(得分:2)

您可以编写自定义脚本来更新包,如下所示,并在包管理器控制台中执行它

$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 }