的NuGet解析错版包相关的 [英] NuGet resolves the wrong version of package dependency

查看:223
本文介绍了的NuGet解析错版包相关的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有一个包,NServiceBus.Host依赖于NServiceBus> = 4.5.0。

So I have a package, NServiceBus.Host that depends on NServiceBus >= 4.5.0.

在的NuGet有一个版本4.5.1 NServiceBus的。当我安装包NServiceBus.Host我得到:

On nuget there is a 4.5.1 version of NServiceBus. When I install-package NServiceBus.Host I get:

PM> install-package nservicebus.host
Attempting to resolve dependency 'NServiceBus (≥ 4.5.0)'.
Attempting to resolve dependency 'NServiceBus.Interfaces (≥ 4.5.0)'.
Installing 'NServiceBus.Interfaces 4.5.0'.
You are downloading NServiceBus.Interfaces from NServiceBus Ltd, the license agreement to which is available at http://particular.net/LicenseAgreement. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'NServiceBus.Interfaces 4.5.0'.
Installing 'NServiceBus 4.5.0'.

正如你所看到的,我得到了4.5.0版本的依赖。

As you can see I get the 4.5.0 version of the dependency.

的NuGet多科它指出:

如果未安装的依赖性,的NuGet经过以下   步骤:

If the dependency is not installed, NuGet goes through the following steps:

的NuGet饲料这是中列举了每一个版本Subkismet的   内部版本规范。的NuGet然后缩小该组只   包具有最低主要/次要版本。其余的   包的NuGet挑选具有最高版本号。

NuGet enumerates every version of Subkismet within the feed that’s within the version specification. NuGet then narrows that set to just the packages with the lowest Major/Minor version. Of the remaining packages, NuGet picks the one with the highest version number.

的NuGet挑选具有最高版本号。在这里显得侵犯,因为有一个永远的版本。

"NuGet picks the one with the highest version number." seems to be violated here since there is a never version.

这是中的NuGet一个错误?

Is this a bug in NuGet?

推荐答案

你指的依赖分辨率的NuGet文档尚未自2010年12月更新,真正的NuGet文档都可以在这里:的https://docs.nuget.org

The NuGet documentation on dependency resolution you refer to hasn't been updated since Dec 2010. The real NuGet docs are available here: https://docs.nuget.org

此外,将的NuGet - 默认情况下 - 解决范围内的最低为major.minor版本允许的,如软件包相关性定义。所以4.5.0是一个正确的默认依赖解析。

Also, NuGet will - by default - resolve the lowest major.minor version within the range allowed, as defined in the package dependencies. So 4.5.0 is a correct default dependency resolution.

新建自的NuGet v2.8.1:可以使用的NuGet包管理器控制台使用备用依赖解析算法:

New since NuGet v2.8.1: you can use an alternate dependency resolution algorithm using the NuGet Package Manager Console:

安装,包装NServiceBus.Host -DependencyVersion HighestPatch

Install-Package NServiceBus.Host -DependencyVersion HighestPatch

有更多的选择,请参考以下文档: <一href="https://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Install-Package">https://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Install-Package

There are more options, check the docs here: https://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Install-Package

这篇关于的NuGet解析错版包相关的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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