Otterprinz
Otterprinz

Reputation: 469

Nuget Package Compatibility and Upgrades

My company has internal components that we deliver via internal NuGet. Now i want to make a Version 5.X of these components which will be breaking a lot from the 4.X versions. However now if my colleagues browse for updates, the Nuget browser would recommend these new packages.

What i would prefer: If example 4.6 is installed, it would take the highest 4.X version but not 5.0 or above. Making packages for the 5.X path under completely different names would be annoying when the developer choses to upgrade.

Is there a way to mark nuget packages to do something like that? If that's not clear, tell me and i try to clarify.

Upvotes: 0

Views: 452

Answers (1)

zivkan
zivkan

Reputation: 15082

If your projects are using packages.config, you can use allowedVersions: https://learn.microsoft.com/en-us/nuget/reference/packages-config#schema

There's no way to do this if your project uses PackageReference, but you can upvote (👍) this isse: https://github.com/NuGet/Home/issues/9082

Upvotes: 1

Related Questions