Bert Cotton
Bert Cotton

Reputation: 136

NuGet Versioning Is Backwards

I've been working to get NuGet versioning squared away in my ASP Core project and have come across some odd behaviors and would like to ask why they decided to do it this way.

1) Choose the lowest version in a range.

ex: [1.0.0, 2.0.0) Does not mean choose the most recentversion in 1.X.X but choose the lowest version, basically always 1.0.0 and never update.

2) Setting the specific version chooses a different version

ex: "1.0.0" will really select "1.0.X". This one really concerns me. I want to make sure that when I tag code, using a specific version, all future builds will always use the same version. With this implementation, builds are not guaranteed to be reproducible!

I'm coming from using Maven and NPM and am trying to keep an open mind to other ways of doing versioning, but these two baffle me.

Please help me understand why they would do this, basically backwards from other package manager solutions.

Upvotes: 0

Views: 72

Answers (1)

Damien Dennehy
Damien Dennehy

Reputation: 4064

  1. You can use a floating version if you want the most recent version, ex 1.0.*.
  2. I think you're incorrect here. If 1.0.0 is requested, it'll install 1.0.0 if 1.0.0 is available on the NuGet server. If it's not found on the server, it'll install the next closest version found, 1.0.1.

This is pretty well documented at

http://docs.nuget.org/consume/ProjectJson-Dependency#dependency-resolution-in-nuget-v3-/-project.json

Upvotes: 1

Related Questions