Package Dependency Minimum Version

Jan 28, 2011 at 8:52 PM

I've set up a repository (file-based - don't know if that matters) with the following:

  • PackageA 0.1.0  (depends on PackageB >=0.1.0, specified with version="0.1.0")
  • PackageB-0.1.0
  • PackageB-0.2.0

Navigating the packages in the UI confirms that PackageA depends on PackageB >=0.1.0 the latest version of PackageB is 0.2.0.  But, when I add a reference to PackageA, PackageB-0.1.0 gets pulled down and when I check the Updates section in the UI I do not see any available updates for PackageB.

Is this desired behavior?  i.e. does NuGet deliberately retrieve the lowest possible version that satisfies a dependency?  
If so (and I hope not - I'd like the latest!), shouldn't the Updates section show that there is an update available for PackageB?

 

Further, it looks like the docs themselves are confused as to what the correct behavior should be:

Dependency versions are specified in the version attribute of the dependency element. For example, the following dependency element specifies a dependency on version 1.3.2 or higher of the package named ExamplePackage.

<dependency id="ExamplePackage" version="1.3.2" />

 

Range Meaning
1.0 1.0 ≤ x
Developer
Jan 28, 2011 at 9:44 PM

We do retrieve the lowest version of a dependency and the docs are correct. For a more complete view of why we do versioning this way is here:

http://blog.davidebbo.com/2011/01/nuget-versioning-part-1-taking-on-dll.html
http://blog.davidebbo.com/2011/01/nuget-versioning-part-2-core-algorithm.html
http://blog.davidebbo.com/2011/01/nuget-versioning-part-3-unification-via.html

Hope that helps

Jan 28, 2011 at 10:53 PM

Thanks for the quick response - those links were really informative.  That answers my question.

As for the fact that it wasn't showing up in the Updates section - it is showing up as an update now, after I opened up the Installed Packages section.  Perhaps it was a caching issue, or maybe just user error...