Skip to content

noun-first form for dotnet CLI package add#14881

Open
Muckenbatscher wants to merge 2 commits intodotnet:release/13.2from
Muckenbatscher:noun-first-package-add
Open

noun-first form for dotnet CLI package add#14881
Muckenbatscher wants to merge 2 commits intodotnet:release/13.2from
Muckenbatscher:noun-first-package-add

Conversation

@Muckenbatscher
Copy link

Description

Use the "noun-first" form for adding NuGet packages. It was introduced in .NET SDK 9 for the CLI.
dotnet package add vs. dotnet add package

This is the form that the dotnet CLI is referencing in the official documentation.
dotnet package add command

Also use the --project flag followed by the path to the project file as suggested by the documentation. But only for apps that are not file-based.
For file-based apps keep the --file flag. (Which doesn't seem to have any official documentation...)

Updated the Aspire.Cli.Tests to expect the "noun-first" form.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

* introduced in the dotnet 9 SDK
* it is the form that is appearing in the dotnet CLI documentation, with `dotnet add package` only being left as a note for SDK version before 9
using `dotnet package add` instead of `dotnet add package`
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14881

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14881"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant