[backport to release/10.0.3xx]Add warnings for newer tool versions during dotnet tool restore#52715
Merged
baronfel merged 3 commits intodotnet:release/10.0.3xxfrom Mar 26, 2026
Conversation
17 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This is a manual backport of PR #51011 to the release/10.0.3xx branch, which adds warnings during dotnet tool restore to inform users when newer versions of tools are available.
Changes:
- Added a new warning system that checks for newer versions of tools during restoration
- Implemented smart prerelease handling: warnings only show for newer stable versions when the current version is stable, but show all newer versions when the current version is prerelease
- Added comprehensive test coverage for version comparison scenarios
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet.Tests/CommandTests/Tool/Restore/ToolRestoreCommandTests.cs | Adds three comprehensive tests covering basic version warnings, prerelease-to-stable warnings, and stable-to-prerelease (no warning) scenarios |
| src/Cli/dotnet/Commands/xlf/*.xlf (13 files) | Adds the new localized string resource "RestoreNewVersionAvailable" across all supported languages with state="new" |
| src/Cli/dotnet/Commands/CliCommandStrings.resx | Adds the new resource string for the version warning message |
| src/Cli/dotnet/Commands/Tool/Restore/ToolRestoreCommand.cs | Extends ToolRestoreResult struct with Warning property and updates display logic to show warnings in yellow for both success and partial failure cases |
| src/Cli/dotnet/Commands/Tool/Restore/ToolPackageRestorer.cs | Implements CheckForNewerVersion method that queries for the latest version and applies prerelease filtering logic; passes warning through to ToolRestoreResult |
This was referenced Jan 28, 2026
Member
Author
|
/ba-g known template engine SSL issue |
Member
Author
|
/ba-g known template engine errors |
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
e2d6375 to
204ff84
Compare
Member
Author
|
/ba-g netanalyzers known issues |
joeloff
reviewed
Mar 26, 2026
| { | ||
| // If the current version is prerelease, show warning for any newer version | ||
| // If the current version is stable, only show warning for newer stable versions | ||
| if (package.Version.IsPrerelease || !latestVersion.IsPrerelease) |
Member
There was a problem hiding this comment.
Should we consider an informational message if a user is on a stable version, but a new prelease is available. For example, the user is on 1.0.0, but 2.0.0-preview.1 is available?
Member
Author
There was a problem hiding this comment.
reasonable extension of the core mechanism for sure 👍
joeloff
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual backport of #51011 because the backport bot failed