Having a dependency on a particular nuget package

We have a bunch of internal packages that we create for use by other teams, and many of them have dependencies on open source packages. I would like to add a dependency on a specific version of the nuget package to my nuspec, so that when the end user installs my package, the dependent packages are also installed.

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" /> </dependencies> 

Which, I was hoping, would only reduce version 2.0.0.4 of MassTransit, however it will downgrade 2.0.0.5, with which my application is currently not working. I tried the following formats, but none of them work:

 version="[2.0.0.4, 2.0.0.5)" version="[2.0.0.4]" version="2.0.0.5)" 

Infact, I can’t get anything in the version range documentation for it to work properly.

I have one thought that masstransit uses a 4-digit version number, and all the examples are 3 digits a-la semver. Could this be the cause of my problem?

Edit:

It turns out that the nuget version on the build server is outdated and does not support the ranges that I wanted to use. Upgraded everything fixed!

+6
source share
1 answer

No, the exact version should do something for you like [version].

+3
source

Source: https://habr.com/ru/post/898246/


All Articles