Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm creating my first nuget package. I added a dependency with a version that is not the latest version. However, I don't want to update to the latest version of this dependency. Is it possible to instruct it to use the specific version?

<dependencies>
  <dependency id="NHibernate" version="3.2.0.3001" />
</dependencies>

When I install the package I see this:

Attempting to resolve dependency 'NHibernate (≥ 3.2.0.3001)'.

This creates the following when I install the package.

<packages>
  <package id="Iesi.Collections" version="3.2.0.4000" />
  <package id="NHibernate" version="3.2.0.4000" />
</packages>

I'd really like to see something like this: Attempting to resolve dependency 'NHibernate (3.2.0.3001)'.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
352 views
Welcome To Ask or Share your Answers For Others

1 Answer

You should be able to force an exact version with brackets:

<dependency id="NHibernate" version="[3.2.0.3001]" />

Full info on the formats you can use are on the NuGet site, here:

http://docs.nuget.org/docs/reference/version-range-specification


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...