在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中的错误吗?
此外,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