Skip to content
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

Closed
lynntian opened this issue Mar 25, 2016 · 12 comments · Fixed by NuGet/NuGet.Client#1634
Assignees
Labels
Functionality:Install The install command in VS/nuget.exe Product:NuGet.exe NuGet.exe Type:Bug
Milestone

Comments

@lynntian
Copy link

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

@emgarten
Copy link
Member

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

What steps are you trying with packages.config?

@emgarten emgarten added the Product:NuGet.exe NuGet.exe label Mar 28, 2016
@emgarten emgarten added this to the Client-VNext milestone Mar 28, 2016
@lynntian
Copy link
Author

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"

@joelverhagen
Copy link
Member

I've reproduced this problem in 3.4.1.

@harikmenon harikmenon modified the milestones: Client-VNext, Future Apr 19, 2016
@gezzahead
Copy link

gezzahead commented Apr 7, 2017

Also reproduced in 4.0.0.2283

@xlegalles
Copy link

Also reproduced in 4.1.0.2450

@emgarten
Copy link
Member

emgarten commented Jul 28, 2017

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!

@emgarten emgarten added the help wanted Considered good issues for community contributions. label Jul 28, 2017
@emgarten
Copy link
Member

Also, giving the issue a thumbs up helps prioritize.

@xlegalles
Copy link

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.

@gezzahead
Copy link

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.

@boarmanc
Copy link

boarmanc commented Aug 9, 2017

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.

@emgarten emgarten self-assigned this Aug 10, 2017
@emgarten emgarten removed the help wanted Considered good issues for community contributions. label Aug 10, 2017
@emgarten emgarten modified the milestones: 4.4, Future-2 Aug 10, 2017
@emgarten
Copy link
Member

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.

@emgarten emgarten mentioned this issue Aug 10, 2017
9 tasks
@emgarten emgarten added the Functionality:Install The install command in VS/nuget.exe label Aug 11, 2017
emgarten added a commit to NuGet/NuGet.Client that referenced this issue Aug 12, 2017
* 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
emgarten added a commit to NuGet/NuGet.Client that referenced this issue Aug 12, 2017
* 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
@emgarten
Copy link
Member

This will be fixed in NuGet.exe 4.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Install The install command in VS/nuget.exe Product:NuGet.exe NuGet.exe Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants