.net – NuGet解析了错误的包依赖版本

前端之家收集整理的这篇文章主要介绍了.net – NuGet解析了错误的包依赖版本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
所以我有一个NServiceBus.Host包依赖于NServiceBus> = 4.5.0.

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

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版本的依赖项.

nuget doco它说:

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

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中的错误吗?

自2010年12月以来,您所引用的依赖性解析的NuGet文档尚未更新.真正的NuGet文档可在此处获取https://docs.nuget.org

此外,NuGet将 – 默认情况下 – 解析允许范围内的最低major.minor版本,如包依赖项中所定义.所以4.5.0是一个正确的默认依赖解析.

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

Install-Package NServiceBus.Host -DependencyVersion HighestPatch

还有更多选项,请查看以下文档:
https://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Install-Package

原文链接:https://www.f2er.com/javaschema/281472.html

猜你在找的设计模式相关文章