简体   繁体   中英

how can i update all my nuget dependencies at once using command line?

my projects has more than 400+ dependencies and I have to update all of them at once with command in .NET 7.0.

I have try nukeeper,do.net-outdated-tool and NuPu. nukeeper and do.net- outdated is already deprecated and Nupu is used to update dependencies simultaneously(one by one). there are so many dependencies so I am not expecting GUI but with command only.

there are so many dependencies so I am not expecting GUI

If you are using Visual Studio or Rider you can bulk update nuget packages via UI.

For VS

Right click on the solution (or project), select "Manage NuGet Packages for Solution...":

在此处输入图像描述

Then select "Updates" and click "Select all packages" and click "Update":

在此处输入图像描述

For Rider

Right click on the solution (or project), "Manage NuGet Packages":

在此处输入图像描述

Then in the NuGet management panel to the left click "Update packages in the Solution" icon:

在此处输入图像描述

And click "Upgrade":

在此处输入图像描述

For CLI you can try using 3rd party tool like do.net-outdated .

The closest I can think using do.net CLI is:

dotnet list package

which (for example) would give: 在此处输入图像描述

Here you are able to see installed nugets, and now just execute

dotnet add package [package name]

which would fetch latest version (or you even can specify --version parameter if you want).

After running:

dotnet add package Microsoft.Extensions.DependencyInjection

I have latest version of nuget: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM