简体   繁体   中英

How to update multiple packages to a desired version in single nuget cli command?

From Nuget CLI is it possible from a single command to upgrade multiple packages to the desired version?

I know we can do

nuget.exe update "FooBar.sln" MyPackage -Version 1.0

but what if I want to update 2 packages to 1.0 ?

This still updates to the latest version but not to the version I desire.

nuget.exe update "FooBar.sln" -Id MyPackage -Id MyPackage2 -Version 1.0

What will be the command for that and will there be any dependency on each other like both package will update only when they both are on a project ( https://stackoverflow.com/a/16302774/1011959 )?

It's possible to specify package version only when you update one package. If you want to do it with NuGet Cli and in one command, you can join several commands like that

nuget.exe update "FooBar.sln" MyPackage -Version 1.0 && nuget.exe update "FooBar.sln" MyPackage2 -Version 2.0

With this approach you can specify different versions for different packages.

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