Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget dependencies between prerelease packages

Tags:

c#

.net

nuget

The scenario is package management with 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.

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.

Actually no 6.x.x 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.

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.

like image 793
Alkampfer Avatar asked Apr 26 '16 12:04

Alkampfer


1 Answers

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.

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.

like image 188
Georg Avatar answered Oct 26 '22 18:10

Georg