Skip to content

PM UI VersionRange constraint updates - #15002

Open
martinrrm wants to merge 1 commit into
devfrom
dev-mruizmares-packageUpdateVersionRanges
Open

PM UI VersionRange constraint updates#15002
martinrrm wants to merge 1 commit into
devfrom
dev-mruizmares-packageUpdateVersionRanges

Conversation

@martinrrm

@martinrrm martinrrm commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

rendered version: https://github.com/NuGet/Home/blob/d16985ab8369de7d3ac82c41843d6093d7097c60/accepted/2026/package-update-version-constraints.md

Description

Adds a PM UI-only design for respecting authored PackageReference version constraints during updates.

The proposal defines how PM UI:

  • keeps automatic updates within the authored range;
  • preserves ranges for in-range selections;
  • replaces the range with a minimum-only version for explicit out-of-range selections;
  • applies the behavior per project in solution view and with Central Package Management.

Define how Package Manager UI preserves authored version ranges for in-range updates and replaces them for explicit out-of-range selections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 87d3cdd3-17dd-489c-ae2e-bb498e755f1d
Comment on lines +10 to +11
Visual Studio Package Manager UI (PM UI) will respect upper-bounded and
floating PackageReference version ranges when finding and applying updates.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we normally format markdown as one line per sentence, not manual line wrapping

Comment on lines +26 to +29
This proposal applies only to PM UI. Package Manager Console,
`dotnet package update`, and other update entry points are outside its scope.
It is intentionally a partial solution to
[NuGet/Home#6566](https://github.com/NuGet/Home/issues/6566).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you suggesting that some time in the future when dotnet package update supports some kind of similar functionality, it's acceptable for it to do so in a way that behaves differently to PM UI?

Even if the initial implementation is only in PM UI and not dotnet package update, I would expect them both to have the same behavior and therefore this is a spec for all NuGet update scenarios, not just PM UI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to scope this spec only to PM UI, but yeah dotnet package update should behave the same, that is a bigger discussion that I was trying to avoid but it's needed.

Comment on lines +181 to +190
### Preserve ranges only for in-range updates

Routine updates should not erase a customer's authored boundary. Setting the
lower bound records the update while retaining the upper-bound policy.

### Replace the range for an explicit out-of-range selection

Selecting an out-of-range concrete version is an explicit request to leave the
current constraint. Replacing it with the normal minimum-only PackageReference
version is predictable and does not require PM UI to infer a new policy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this entire spec written by AI? I haven't yet started reading the other subheadings under "rationale and alternatives", but these two are repeating what the rest of the spec already explained. I suspect the AI saw that this is a rationale section and is now trying to justify it, but I feel like it's making it harder for me to read.

Comment on lines +192 to +196
### Do not shift or widen the range automatically

PM UI could infer `[9.1.0, 10.0.0)` or widen the old range, but either behavior
guesses the customer's intended upper bound. The customer can author a new
range separately when needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only makes sense if you remember that most of the previous examples used the example of updating to version 9.1.0 when the previous range was [8.0.0, 9.0.0). Otherwise, this paragraph is quite confusing.

Comment on lines +204 to +208
### Use the existing PackageReference range

Using the existing `Version` or `PackageVersion` range avoids a new project
model contract. A future update-only constraint could separate update policy
from restore semantics, but that is outside this proposal.

@zivkan zivkan Jul 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a project is packed, the PackageReference version range becomes the package dependency's version range. Overloading the Version therefore prevents having separate controls.

For example, I don't believe that Microsoft.Extensions.DependencyInjection has ever had a breaking change. If I want to stay on the 10.* package versions until I retarget my project to net12..0, that doesn't mean my package is incompatible with 11.* packages. Only, I don't want NuGet to suggest those versions as an upgrade.

The prior art section already mentions packages.config's allowedVersions attribute, but this alternatives section says it doesn't want to introduce a "new project model contract", while failing to acknowledge that an upper range in the existing Version already has a semantic meaning.

Additionally, "A future update-only contraint could superate update policy from restore semantics" is basically saying we can introduce breaking changes in the future. I think it's better to introduce something different now, so that we don't need breaking changes in the future.

Going back to customer intent, I think customers are trying to use Version="[8.0.0, 9.0.0)" not because they believe that version 9 and above are incompatible with their project, but as an attempt to get this "update range" behavior, before they find out that it doesn't actually work that way. So, I feel like this proposal is reinforcing customers believe of using the wrong tool for the job. I think we should implement a separate allowedUpates="[8.0.0, 9.0.0)" or allowedUpdate="8.*" instead, and leave the version to retain its existing compatible version semantics.

The behavior in this spec still makes sense when a package is incompatible with higher versions, so the developer wants to bump the version and keep the max compatible version. But the motivation in this spec is not aligned with that scenario.

@Nigusu-Allehu

Copy link
Copy Markdown
Member

Pr review meeting: @martinrrm should we have a spec review discussion on this?

@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity No recent activity. label Aug 28, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 30 days. It will be closed if no further activity occurs within another 15 days of this comment, unless it has a "Status:Do not auto close" label. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:No recent activity No recent activity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants