-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuget.exe (3.+) install package with Version number and ExcludeVersion flag doesn't update package to newer version #2405
Comments
What steps are you trying with packages.config? |
Example: |
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. |
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. |
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. |
* Allow updating packages when -ExcludeVersion is used * Improved detection of already installed packages when -ExcludeVersion is used * Adding -Framework switch to allow setting the target framework used when resolving dependencies. * Remove NU1000 code from packages.config restore errors. * Avoid unneeded downloads when a version is not given and the package is cached. * Disable parallel for mono * Display errors and return a non-zero exit when install on packages.config fails * Remove old files during upgrades with -ExcludeVersion Fixes NuGet/Home#5743 Fixes NuGet/Home#5737 Fixes NuGet/Home#5736 Fixes NuGet/Home#5741 Fixes NuGet/Home#5017 Fixes NuGet/Home#3957 Fixes NuGet/Home#2405
* Allow updating packages when -ExcludeVersion is used * Improved detection of already installed packages when -ExcludeVersion is used * Adding -Framework switch to allow setting the target framework used when resolving dependencies. * Remove NU1000 code from packages.config restore errors. * Avoid unneeded downloads when a version is not given and the package is cached. * Disable parallel for mono * Display errors and return a non-zero exit when install on packages.config fails * Remove old files during upgrades with -ExcludeVersion Fixes NuGet/Home#5743 Fixes NuGet/Home#5737 Fixes NuGet/Home#5736 Fixes NuGet/Home#5741 Fixes NuGet/Home#5017 Fixes NuGet/Home#3957 Fixes NuGet/Home#2405
This will be fixed in NuGet.exe 4.4.0 |
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
The text was updated successfully, but these errors were encountered: