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 中指定特定的依赖版本?
基础教程推荐
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
