简体   繁体   English

预发布包之间的 Nuget 依赖项

[英]Nuget dependencies between prerelease packages

The scenario is package management with NuGet.该方案是使用 NuGet 进行包管理。

Suppose you have PackageA that depends on PackageB, you publish both of them so whenever you publish PackageA, you specify the version range of Package B you depends on.假设您有依赖于 PackageB 的 PackageA,您发布它们两个,因此无论何时发布 PackageA,您都指定依赖的 Package B 的版本范围。

Now both of the packages are automatically published with a Build, and they use SemVer (GitVersion.exe), version 6.0.0 of PackageA declares that it needs at least version 6.0.0 of Package B. This works perfectly if packages are in stable version.现在这两个包都用 Build 自动发布,并且它们使用 SemVer (GitVersion.exe),PackageA 的 6.0.0 版声明它至少需要 Package B 的 6.0.0 版。如果包处于稳定状态,这完美地工作版本。

Actually no 6.xx stable version exists for both package and if I'm installing the prerelease version of PackageA it complains because it needs at least version 6.0.0 of packageB, but packageB has only 6.0.0-prerelease version.实际上,这两个包都不存在 6.xx 稳定版本,如果我正在安装 PackageA 的预发布版本,它会抱怨,因为它至少需要 packageB 的 6.0.0 版本,但 packageB 只有 6.0.0-prerelease 版本。

Here is the error.这是错误。

Unable to resolve dependencies. 'PackageB 6.0.0-unstable0066' is not compatible with 'PackageA 6.0.0-unstable0015 constraint: PackageB (>= 6.0.0)'.

My question is, how is the correct way to manage dependencies from pre-release version of packages?我的问题是,从包的预发布版本管理依赖项的正确方法是什么?

Thanks.谢谢。

For me, this is a clear bug at NuGet, because even if you explicitly add a reference to PackageB 6.0.0-unstablewhatever, NuGet claims that the packages are incomatible.对我来说,这是 NuGet 的一个明显错误,因为即使您明确添加对 PackageB 6.0.0-unstablewhatever 的引用,NuGet 也声称这些包是不兼容的。

Or, to be more precise, it does that if you are using package references.或者,更准确地说,如果您使用包引用,它会这样做。 If you use the old package.config format, NuGet is happy to accept the prerelease package.如果您使用旧的 package.config 格式,NuGet 很乐意接受预发布包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NuGet将项目依赖项打包为nuget依赖项 - NuGet packages project dependencies as nuget dependencies 在本地制作NuGet个包的依赖 - Make Dependencies of NuGet packages locally 考虑到它们之间的依赖关系,我应该如何将我的项目发布为 NuGet 包? - How should I publish my projects as NuGet packages considering dependencies between them? Facebook WebMVC和Facebook NuGet软件包之间有什么区别? - What is the difference between the FacebookWebMVC the Facebook NuGet packages? nuget package 与其参考的 nuget 封装之间的不同版本 - Different versions between a nuget package and its referenced nuget packages .NET — 管理不同版本的 NuGet 包的公共依赖项 - .NET — Managing NuGet packages’ common dependencies with different versions .Net / VisualStudio如何处理具有相同nuget包的项目依赖项,每个项目具有不同的nuget目标 - How .Net/VisualStudio handles having projects dependencies each with different nuget target for same nuget packages 在C#项目中更新带有和不带有预发行标志的nuget软件包 - Updating nuget package with and without prerelease flag in a C# project C#AssemblyVersion 3位数用于NuGet的PreRelease版本控制 - C# AssemblyVersion 3 digits for use with NuGet's PreRelease versioning 如何禁止在Release Pipeline中使用preRelease版本的nuget软件包 - How to Forbid the usage of a PreRelease version of a nuget package in Release Pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM