Having a dependency on a specific nuget package
We have a bunch of internal packages that we create for other teams to consume, and many of these have dependencies on open sources packages. I would like to add a dependency to a specific version of a nuget package to my nuspec, such that when the end user installs my package the dependent packages get installed too.
My <dependencies>
section of my nuspec looks like this:
<dependencies>
<dependency id="MassTransit" version="2.0.0.4" />
<dependency id="MassTransit.RabbitMQ" version="2.0.0.4" />
</dependen开发者_JS百科cies>
Which I was hoping would bring down only version 2.0.0.4 of MassTransit, however it brings down 2.0.0.5, which my application currently doesn't work with. I've tried the following formats, but none of them seem to work:
version="[2.0.0.4, 2.0.0.5)"
version="[2.0.0.4]"
version="2.0.0.5)"
Infact, I can't seem to get anything in the documentation about version ranges to work properly.
I do have one thought, which is that masstransit is using a 4 digit version number, while all the examples are 3 digits a-la semver. Is this what could be causing my problem?
Edit:
It turns out the version of nuget on the build server was out of date and didn't support the ranges I wanted to use. Upgrading it fixed everything!
No, doing something like [version] should get you the exact version.
精彩评论