Skip to content

Conversation

@zivkan
Copy link
Member

@zivkan zivkan commented Jun 10, 2025

Bug

Fixes: NuGet/Home#14306

Description

Allow dotnet package update to update to a specific version using the packageId@version syntax that dotnet package add already supports (possibly dotnet tool install as well). It also supports version ranges, in case that's what the customer wants in their project file. For example, dotnet package update "Contoso.Utils@[1.2.3, 2.0.0)".

The package@version parsing is done in the CLI parser, so that when there's an error, the CLI parser can do error handling (after all, it's an input error).

Made the version chooser mockable, so that the logic to decide if the package source should be queried can be tested without needing a real package source.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. Document dotnet package update command Home#14354

@zivkan zivkan requested a review from a team as a code owner June 10, 2025 07:38
@zivkan zivkan requested review from jeffkl and nkolev92 June 10, 2025 07:38
@zivkan zivkan requested review from donnie-msft and nkolev92 June 11, 2025 01:47
@zivkan zivkan force-pushed the dev-zivkan-update-version branch from 0a05dc9 to 17a46ea Compare June 12, 2025 21:33
@zivkan zivkan merged commit eb38c4a into dev Jun 17, 2025
17 of 18 checks passed
@zivkan zivkan deleted the dev-zivkan-update-version branch June 17, 2025 07:19
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.

dotnet package update to a specific version

6 participants