Skip to content

Respect upper bounds of Version Range when updating in UI, PMC and dotnet package update #6566

Description

@zhili1208

Hi everyone at NuGet.org.

I’m using new format of the nuget package management that is fully integrated with MSBuild, it is very awesome and work very good except that it have one really odd error.
In old format(packages.config), we could use allowedVersions to limit version of allowed nugets, in this new format Version range should specified in Version tag of the PackageReference but
we have 2 problems with this:

  1. PackagaeManagerConsole does not respect this version limit,
    So if I have Version=”[1.0.0, 1.5.0)” and there is a version 2.0.0 of the package, UI respect my limitation and show no update but Update-Package command will update my
    reference to version 2.0.0
  2. If package updated to a newer version(a version that is allowed in my range), then new version will be written in place of old version and it will remove my version range limit
    So if I have Version=”[1.0.0, 1.5.0)” and there is version 1.1.0 and 2.0.0 of the package, and I use nuget UI, it will update my project to version 1.1.0 as expected, but as a
    side effect it will change my Version tag to Version=”1.1.0” and so remove my version limitation, and now it will show that I have an update for version 2.0.0.

I want to know how I use this new format and use old good allowedVersions or something that have same effect.

Ideas in #14767 and dotnet package update equivalent in #14313

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions