Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Preserve version ranges when upgrading packages - #702

#702
Open
GREsau wants to merge 3 commits into
dotnet-outdated:masterdotnet-outdated/dotnet-outdated:masterfrom
GREsau:version-rangeGREsau/dotnet-outdated:version-rangeCopy head branch name to clipboard
Open

Preserve version ranges when upgrading packages#702
GREsau wants to merge 3 commits into
dotnet-outdated:masterdotnet-outdated/dotnet-outdated:masterfrom
GREsau:version-rangeGREsau/dotnet-outdated:version-rangeCopy head branch name to clipboard

Conversation

@GREsau

@GREsau GREsau commented Feb 11, 2026

Copy link
Copy Markdown

Fixes #388

This PR changes the behaviour of the --upgrade command to preserve the max version specified in a package reference, e.g. <PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="[6.0.13,7)" />.

For example, upgrading a project with would change the version of Microsoft.AspNetCore.Authentication.Negotiate in the csproj from/to:
[6.0.13,7) -> [6.0.36, 7.0.0)
[6.0.13,7] -> [7.0.0]
[6.0.13] -> "No outdated dependencies were detected", as the version is pinned
[6.0.13,) -> 8.0.24
6.0.13 -> 8.0.24
6.* -> 8.0.24
[6.*, 8) -> [7.0.20, 8.0.0)

Note that this does not preserve "floating" versions like 6.*.

However, if the new version is outside the the declared version range (which can happen due to #670), then we remove the maximum version to avoid setting an unsatisfiable version range. e.g. when running dotnet outdated -u -mv 8.0, [6.0.13,7) is updated to 8.0.24 instead of [8.0.24, 7.0.0).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version ranges are not preserved when upgrading packages

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.