[release/10.0.3xx] Fix dotnet remove package project argument#53419
Merged
martinrrm merged 2 commits intorelease/10.0.3xxfrom Mar 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 intoPackageRemoveCommandpath 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.
nkolev92
approved these changes
Mar 13, 2026
This was referenced Mar 16, 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.
Port of #53401 into release/10.0.3xx