如何在 nuspec 中指定特定的依赖版本? [英] How to specify specific dependency version in nuspec?

查看:39
本文介绍了如何在 nuspec 中指定特定的依赖版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建我的第一个 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:

http://docs.nuget.org/docs/reference/version-范围规格

这篇关于如何在 nuspec 中指定特定的依赖版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆