Skip to content

Conversation

meaghanlewis
Copy link
Contributor

@meaghanlewis meaghanlewis commented Sep 29, 2025

Summary

This pull request updates the documentation for several .NET CLI commands to align with the .NET 6 SDK and later, and improves accuracy, consistency, and clarity across multiple command reference articles. The most important changes include updating supported version statements, revising command option lists and defaults, and adding new options and help references. Below are the most significant changes grouped by theme.

Documentation version updates

  • Changed the applicability statements in all affected CLI command docs (dotnet-build.md, dotnet-clean.md, dotnet-dev-certs.md, dotnet-format.md, dotnet-msbuild.md, dotnet-pack.md) to specify ".NET 6 SDK and later versions" for improved clarity and consistency. [1] [2] [3] [4] [5] [6]

Command option and behavior improvements

  • Updated the synopsis and option lists for dotnet build, dotnet pack, and dotnet format to reflect current CLI syntax, including reordering, renaming, and clarifying options such as --self-contained, --use-current-runtime, and --disable-build-servers. Default behaviors for options like --self-contained are now more accurately described. [1] [2] [3] [4] [5]

  • Added new options and improved descriptions, such as --check-trust-machine-readable for dotnet dev-certs, and expanded the option explanations for dotnet format to include new filtering and reporting capabilities. [1] [2] [3]

Inclusion of help and interactive references

  • Standardized the placement and inclusion of [!INCLUDE [help](...)] and [!INCLUDE [interactive](...)] blocks across all command docs for improved discoverability and consistency. [1] [2] [3] [4] [5] [6]

Example and formatting consistency

  • Improved example commands and formatting in dotnet format.md to match new option syntax, and clarified usage scenarios for style and analyzer subcommands.

Minor corrections and updates

  • Updated ms.date fields to reflect the new documentation revision date and made minor formatting corrections in "See also" sections and option lists. [1] [2] [3]

These changes help keep the documentation up to date with the latest SDK releases and provide clearer guidance for users of the .NET CLI.

Fixes #48686


Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
docs/core/tools/dotnet-build.md dotnet build
docs/core/tools/dotnet-clean.md dotnet clean command
docs/core/tools/dotnet-dev-certs.md dotnet dev-certs
docs/core/tools/dotnet-format.md docs/core/tools/dotnet-format
docs/core/tools/dotnet-msbuild.md dotnet msbuild
docs/core/tools/dotnet-pack.md dotnet pack command
docs/core/tools/dotnet-package-remove.md dotnet package remove
docs/core/tools/dotnet-publish.md docs/core/tools/dotnet-publish
docs/core/tools/dotnet-restore.md dotnet restore
docs/core/tools/dotnet-run.md dotnet run command
docs/core/tools/dotnet-sdk-check.md dotnet sdk check
docs/core/tools/dotnet-store.md docs/core/tools/dotnet-store
docs/core/tools/dotnet-test.md dotnet test
docs/core/tools/dotnet-watch.md dotnet watch

@meaghanlewis meaghanlewis marked this pull request as ready for review September 30, 2025 18:04
@meaghanlewis meaghanlewis requested review from adegeo and a team as code owners September 30, 2025 18:04
Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). If you use this option with .NET 6 SDK, use `--self-contained` or `--no-self-contained` also. If not specified, the default is to build for the current OS and architecture.

- **`--self-contained [true|false]`**
- **`--sc|--self-contained`**
Copy link
Contributor

Choose a reason for hiding this comment

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

Is dropping of true/false intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's intentional. I didn't see that on other --sc|--self-contained options, or any other options, and wanted to be consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

It might be confusing to omit it, because the name reads like you're making it self contained, but it actually defaults to false if you just put --self-contained. Also, maybe add a remark about how it relates to no-self-contained on line 114.

Copy link
Contributor

@adegeo adegeo Oct 1, 2025

Choose a reason for hiding this comment

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

In .NET 10 at least, it defaults to true.

Edit
I checked back to .NET 6 and it's defaulting to true.

Copy link
Contributor

Choose a reason for hiding this comment

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

That should be noted, then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, thanks y'all. I'll update.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I just edited my comment without reloading yours 😁

Copy link
Contributor

Choose a reason for hiding this comment

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

I think perhaps the description in help output for the command is actually wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adegeo I was about to ask...the help output says in .NET 7 or lower it defaults to true. I'll test it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Meaghan and I talked a bit. We discovered that the description was wrongly changed a few years ago. I opened a PR to fix it: dotnet/sdk#51088

meaghanlewis and others added 4 commits October 1, 2025 09:36
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing dotnetcommands and options
3 participants