如何在 nuspec 中指定特定的依赖版本?

编程入门 行业动态 更新时间:2024-10-26 03:38:20
本文介绍了如何在 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:

docs.nuget/docs/reference/version-范围规格

更多推荐

如何在 nuspec 中指定特定的依赖版本?

本文发布于:2023-11-27 20:55:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639570.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   如何在   nuspec

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!