How to specify specific dependency version in nuspec?(如何在 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 中指定特定的依赖版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 nuspec 中指定特定的依赖版本?


- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01