我正在创建我的第一个 nuget 包.我添加了一个不是最新版本的依赖项.但是,我不想更新到此依赖项的最新版本.是否可以指示它使用特定版本?
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>我真的很想看到这样的东西:正在尝试解决依赖项NHibernate (3.2.0.3001)".
I'd really like to see something like this: Attempting to resolve dependency 'NHibernate (3.2.0.3001)'.
推荐答案你应该能够强制使用括号的精确版本:
You should be able to force an exact version with brackets:
<dependency id="NHibernate" version="[3.2.0.3001]" />您可以使用的格式的完整信息在 NuGet 网站上,这里是:
Full info on the formats you can use are on the NuGet site, here:
docs.nuget/docs/reference/version-范围规格
更多推荐
如何在 nuspec 中指定特定的依赖版本?
发布评论