I am trying to update a single package in a csproj with multiple dependencies. That is, the packages.config file looks like this:
<packages>
<package id="PackageA" version="1.2.1" targetFramework="net40" />
<package id="PackageB" version="2.3.4" targetFramework="net40" />
<package id="PackageC" version="1.0.0" targetFramework="net40" />
</packages>
I'd like to update PackageA without updating the others. I see that Update-Package in the Visual Studio package manager has this capability, but this needs to run on a TFS build machine.
Is there a way to do this from the command line? The anticipated workflow is the build machine running
- Nuget.exe restore
- Nuget.exe update (on each csproj file)
But the update command does not allow us to specify which package to update on. I know there is an allowedVersions tag for the packages, but that is would require us to change the packages.config file when creating different branches that require different components to update or not, whereas a package-specific, csproj-specific command-line would allow us to associate the dependencies to update with each TFS branch via its build definitions.
nuget.exe update
has an-Id
argument that specifies the project. So, for instance,