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

Time:01-25

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,dotnet-outdated-tool and NuPu. nukeeper and dotnet- 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.

CodePudding user response:

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...":

enter image description here

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

enter image description here

For Rider

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

enter image description here

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

enter image description here

And click "Upgrade":

enter image description here

For CLI you can try using 3rd party tool like enter image description here

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: enter image description here

  • Related