Home: Nuget.exe (3.+) install package with Version number and ExcludeVersion flag doesn't update package to newer version

Created on 25 Mar 2016  路  12Comments  路  Source: NuGet/Home

Stumble upon this issue trying to upgrade a package from version 1.0.0 to 1.0.1
Example:
nuget install <myPackage> -Version 1.0.0 -ExcludeVersion
Install success
Then bump up version number:
nuget install <myPackage> -Version 1.0.1 -ExcludeVersion
Package "xxx" is already installed

This works with nuget 2.8

nuget 2.8 I see output:
Uninstalling package.old.version.number
Installing package.new.version.number

None of these work when I use package.config. Even with version 2.8

Install NuGet.exe Bug

Most helpful comment

We are using nuget in a similar way to xlegalles, in that as part of our CI we use various tools (Fake, plus some homegrown ones) that have been packaged. During the build process we always want the latest version of these tools, and it's more difficult to use them later in the build if the path includes the version.
Currently we work-around this problem by deleting the folders each time, but this is clearly not ideal as we pay the price of re-downloading and extracting the packages each time.

All 12 comments

None of these work when I use package.config. Even with version 2.8

What steps are you trying with packages.config?

Example:
nuget install packages.config -ExcludeVersion -Source xx
It won't know that I changed the version in packages.config and always return "All packages are installed"

I've reproduced this problem in 3.4.1.

Also reproduced in 4.0.0.2283

Also reproduced in 4.1.0.2450

This issue would gain better traction if some scenarios and examples of why ExcludeVersion with Update is important. How common is this?

And as always, a PR for this would be greatly appreciated!

Also, giving the issue a thumbs up helps prioritize.

Ok, in our particular scenario, we use Nuget to install a tool (e.g. Fake) which is invoked by a PS script. Of course we do not want to update the script each time we update the invoked tool and that's why we want to exclude the version from the folder.
Don't take it the wrong way but I consider that if you support such a feature (i.e. install a package wo the version in the folder name), it should just work as usual.

We are using nuget in a similar way to xlegalles, in that as part of our CI we use various tools (Fake, plus some homegrown ones) that have been packaged. During the build process we always want the latest version of these tools, and it's more difficult to use them later in the build if the path includes the version.
Currently we work-around this problem by deleting the folders each time, but this is clearly not ideal as we pay the price of re-downloading and extracting the packages each time.

Similar use case here - we have multiple msbuild scripts that move and copy package files around. Not having to specify version numbers means the scripts can be generic and still work even as that nuget packages are 'reved' over time.

Thanks for the feedback everyone, this looks like a pretty common scenario. I took a look through the code and it should be possible to get the old 2.x behavior back and fix this in 4.x.

This will be fixed in NuGet.exe 4.4.0

Was this page helpful?
0 / 5 - 0 ratings