Reputation: 4324
Let's assume that there is one project depended on the xunit v 1.9.1 package and its output assembly is published as nuget package.
Now, if the package is installed using the Install-Package
command, the depended xunit package will be installed as v1.9.2 not v1.9.1.
I cannot observe this case in other packages. Is there any point making this case?
At this question, the nuget version is v2.7.
[update]
The following code snippet is part of the nuspec file of my test project mentioned above.
<dependencies>
<dependency id="xunit" version="1.9.1" />
<dependency id="Moq" version="4.0.10827"/>
</dependencies>
When I install my test project, the Moq package was installed as the same version specified above but the recent Moq version is v4.1.1308.2321, which is not breaking change according to semver. On the contrary, the xunit package was installed as the lastest v 1.9.2.
Upvotes: 0
Views: 406
Reputation: 17307
This depends on the package manifest. If you are letter the pack
command detect the dependencies from a csproj
, the it will specify the version as 1.9.1. However, NuGet treats this as the min version, not the required version.
See http://docs.nuget.org/docs/reference/versioning#Specifying_Version_Ranges_in_.nuspec_Files
Now, because the new version is 1.9.2, it is not considered a breaking change per Semantic Versioning, therefore it is safe to install.
Also note this blog post as to how NuGet resolves versions. That is, it will install the latest patch for a specified Major and Minor version.
http://blog.davidebbo.com/2011/01/nuget-versioning-part-2-core-algorithm.html
Upvotes: 1
Reputation: 10697
Do you specify a version explicitly? If not, then I'm not surprised at all that 1.9.2 is installed, since that's most recent, and it's backward compatible with 1.9.1.
This is an expected behavior of package management systems in general, that if you don't specify version explicitly, it'll try to grab the newest ones.
You can change that behavior at the project's reference entry (telling exact or minimal version number). Things can also depend on the meta-data of nuget packages.
Upvotes: 0