Skip to content

[release/10.0.3xx] Fix dotnet remove package project argument#53419

Merged
martinrrm merged 2 commits intorelease/10.0.3xxfrom
martinrrm-10.0.3xx-port-9984cae8fc3f6ab6ba0455e3ff47acb3d960c5f8
Mar 13, 2026
Merged

[release/10.0.3xx] Fix dotnet remove package project argument#53419
martinrrm merged 2 commits intorelease/10.0.3xxfrom
martinrrm-10.0.3xx-port-9984cae8fc3f6ab6ba0455e3ff47acb3d960c5f8

Conversation

@martinrrm
Copy link
Copy Markdown
Contributor

Port of #53401 into release/10.0.3xx

@martinrrm martinrrm requested a review from a team as a code owner March 12, 2026 18:09
Copilot AI review requested due to automatic review settings March 12, 2026 18:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Ports #53401 into release/10.0.3xx to fix a regression where dotnet remove <PROJECT> package <PACKAGE> fails to recognize the positional project argument (NuGet/Home#14801).

Changes:

  • Wire the positional <PROJECT | FILE> argument into PackageRemoveCommand path resolution.
  • Extend the remove-package command definition base type to surface the positional project/file argument from hidden commands.
  • Add a regression test covering dotnet remove <relative-project-path> package <package>.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/dotnet.Tests/CommandTests/Package/Remove/GivenDotnetRemovePackage.cs Adds a regression test for removing a package using a positional project argument.
src/Cli/dotnet/Commands/Package/Remove/PackageRemoveCommand.cs Passes the command’s project/file argument to ProcessPathOptions so positional paths are honored.
src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Package/PackageRemoveCommandDefinition.cs Adds GetProjectOrFileArgument() to the remove command definition hierarchy.
src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Hidden/Remove/RemovePackageCommandDefinition.cs Supplies the parent remove command’s positional project/file argument to the package subcommand.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/dotnet.Tests/CommandTests/Package/Remove/GivenDotnetRemovePackage.cs Outdated
@martinrrm martinrrm merged commit 33f0825 into release/10.0.3xx Mar 13, 2026
28 checks passed
@martinrrm martinrrm deleted the martinrrm-10.0.3xx-port-9984cae8fc3f6ab6ba0455e3ff47acb3d960c5f8 branch March 13, 2026 21:30
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.

3 participants