.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

相关文章

迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图...
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,...
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定...
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个...
命令模式(Command)命令模式(Command)[Action/Transactio...
生成器模式(Builder)生成器模式(Builder)意图:将一个对...