Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you only update NuGet packages with certain IDs?

Tags:

nuget

According to the NuGet documentation:

Update Command

Update packages to latest available versions. This command also updates NuGet.exe itself.

Usage nuget update <packages.config|solution>

Options:

Id - Package ids to update.

This says that the ID option is the package IDs to update. How do you provide multiple ID's?

This works:

NuGet.exe update "MySln.sln" -RepositoryPath "MyRepoPath" -id Ref1

...but how do you also udpate Ref2? This fails:

NuGet.exe update "MySln.sln" -RepositoryPath "MyRepoPath" -id Ref1,Ref2

I am trying to update a subset of packages and prevent the need for a large number of calls to NuGet.exe.

like image 427
infojolt Avatar asked Apr 30 '13 09:04

infojolt


People also ask

How do I update NuGet by itself?

If there's an update and the solution is opened, nuget.exe will be removed from the solution. You could automatically update nuget.exe on restore by modifying the . nuget\nuget. targets to add the above command.

What does update package reinstall do?

Update-Package –reinstall reinstalls the same version of the original package, but installs the latest version of dependencies unless specific version constraints are provided. This allows you to update only the dependencies as required to fix an issue.


1 Answers

You can specify the -id option several times:

NuGet.exe update "MySln.sln" -RepositoryPath "MyRepoPath" -id Ref1 -id Ref2
like image 178
Julian Avatar answered Oct 12 '22 22:10

Julian