Lars Tallinger
Lars Tallinger

Reputation: 1

Central package management - Trying to limit installable versions of a package

I am fairly new at professional development and just recently started a job. Due to a change in licensing for a package that is used we have to limit it so nobody can use and preferably not even attempt to install a version above a certain limit.

All information I have found on this so far seems to be old information that does not work for me.

Does anyone know a way to actually limit the installation version and not just the update function?

We use the central package management system and I have tried using suggestions I have found online.

For example this was supposed to set allowed versions between 6 and 7.x.x:

<PackageVersion Include="PackageName" Version="[6, 8)" />

But this only seemed to make the update button pick the highest allowed version. I could still manually select any version and it would just override whatever was written in the Directory.Packages.props file to whatever version I picked. For example:

<PackageVersion Include="PackageName" Version="9.1" />

And then any version limiting I had tried to do would be gone. The old packages.config system had an AllowedVersions value that based on my searching would actually show every other version in the NuGet installer as disabled versions, assuming it was not an edited screenshot. It is something like this I need.

Upvotes: 0

Views: 9

Answers (0)

Related Questions