Skip to content

Add support for CPM with dotnet package update - #6796

Merged
zivkan merged 6 commits into
devfrom
dev-zivkan-update-cpm
Sep 30, 2025
Merged

zivkan merged 6 commits into
devfrom
dev-zivkan-update-cpm

Conversation

@zivkan

@zivkan zivkan commented Sep 23, 2025 •

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14318

Description

dotnet package update uses the existing helper methods written for dotnet package add to modify project files, and it supports CPM by using VersionRange.OriginalString to write the exact string that customers wrote on the command line. However, the constructor for VersionRange can create instances where OriginalString is null. So, use VersionRange.Parse instead to ensure that OriginalString will always have a value for MSBuildAPIUtility to use.

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.

@zivkan
zivkan requested a review from a team as a code owner September 23, 2025 05:43
nkolev92
nkolev92 previously approved these changes Sep 23, 2025
@jeffkl jeffkl changed the title make CPM work with dotnet package update Add support for CPM with dotnet package update Sep 23, 2025
Comment thread test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetAddPackageTests.cs Outdated
@zivkan
zivkan force-pushed the dev-zivkan-update-cpm branch from e958b9a to f1715ad Compare September 30, 2025 03:32
@zivkan
zivkan requested a review from nkolev92 September 30, 2025 10:18
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 should support CPM and VersionOverride

4 participants