From ad0e1645379dcaa0b2359a4c8ee8d8342ab539ff Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Mon, 29 Sep 2025 14:03:38 -0700 Subject: [PATCH 01/12] refresh dotnet command reference to use latest commands and .NET 6 and later versions --- docs/core/tools/dotnet-dev-certs.md | 20 +++++++++------- docs/core/tools/dotnet-msbuild.md | 4 ++-- docs/core/tools/dotnet-pack.md | 14 +++++------- docs/core/tools/dotnet-package-remove.md | 28 ++++++++++++++++------- docs/core/tools/dotnet-restore.md | 8 +++++-- docs/core/tools/dotnet-run.md | 29 +++++++++++++++++------- docs/core/tools/dotnet-store.md | 16 +++++++++---- docs/core/tools/dotnet-test.md | 7 ++++-- docs/core/tools/dotnet-watch.md | 22 ++++++++++++++---- 9 files changed, 101 insertions(+), 47 deletions(-) diff --git a/docs/core/tools/dotnet-dev-certs.md b/docs/core/tools/dotnet-dev-certs.md index a053f0964952b..1e3c9d9341b0b 100644 --- a/docs/core/tools/dotnet-dev-certs.md +++ b/docs/core/tools/dotnet-dev-certs.md @@ -1,11 +1,11 @@ --- title: dotnet dev-certs command description: The dotnet dev-certs command generates a self-signed certificate to enable HTTPS use in development. -ms.date: 07/14/2022 +ms.date: 09/29/2025 --- # dotnet dev-certs -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name @@ -18,7 +18,7 @@ dotnet dev-certs https [-c|--check] [--clean] [-ep|--export-path ] [--format] [-i|--import] [-np|--no-password] [-p|--password] [-q|--quiet] [-t|--trust] - [-v|--verbose] [--version] + [-v|--verbose] [--version] [--check-trust-machine-readable] dotnet dev-certs https -h|--help ``` @@ -140,6 +140,10 @@ The `dotnet dev-certs` command manages a self-signed certificate to enable HTTPS Display debug information. +- **`--check-trust-machine-readable`** + + Same as running `--check --trust`, but outputs the results in json. + ## Examples - Check for the presence of a development certificate, and create one in the default certificate store if one doesn't exist yet. But don't trust the certificate. @@ -188,8 +192,8 @@ The `dotnet dev-certs` command manages a self-signed certificate to enable HTTPS ## See also -* [Generate self-signed certificates with the .NET CLI](../additional-tools/self-signed-certificates-guide.md) -* [Enforce HTTPS in ASP.NET Core](/aspnet/core/security/enforcing-ssl) -* [Troubleshoot certificate problems such as certificate not trusted](/aspnet/core/security/enforcing-ssl#troubleshoot-certificate-problems-such-as-certificate-not-trusted) -* [Hosting ASP.NET Core images with Docker over HTTPS](/aspnet/core/security/docker-https) -* [Hosting ASP.NET Core images with Docker Compose over HTTPS](/aspnet/core/security/docker-compose-https) +- [Generate self-signed certificates with the .NET CLI](../additional-tools/self-signed-certificates-guide.md) +- [Enforce HTTPS in ASP.NET Core](/aspnet/core/security/enforcing-ssl) +- [Troubleshoot certificate problems such as certificate not trusted](/aspnet/core/security/enforcing-ssl#troubleshoot-certificate-problems-such-as-certificate-not-trusted) +- [Hosting ASP.NET Core images with Docker over HTTPS](/aspnet/core/security/docker-https) +- [Hosting ASP.NET Core images with Docker Compose over HTTPS](/aspnet/core/security/docker-compose-https) diff --git a/docs/core/tools/dotnet-msbuild.md b/docs/core/tools/dotnet-msbuild.md index 6d6d51c926c81..6342ff8190ff6 100644 --- a/docs/core/tools/dotnet-msbuild.md +++ b/docs/core/tools/dotnet-msbuild.md @@ -1,11 +1,11 @@ --- title: dotnet msbuild command description: The dotnet msbuild command provides access to the MSBuild command line. -ms.date: 02/14/2020 +ms.date: 09/29/2025 --- # dotnet msbuild -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index e21a1e37127d4..0a413748ac6d8 100644 --- a/docs/core/tools/dotnet-pack.md +++ b/docs/core/tools/dotnet-pack.md @@ -1,11 +1,11 @@ --- title: dotnet pack command description: The dotnet pack command creates NuGet packages for your .NET project. -ms.date: 04/04/2024 +ms.date: 09/29/2025 --- # dotnet pack -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name @@ -15,11 +15,7 @@ ms.date: 04/04/2024 ```dotnetcli dotnet pack [|] [--artifacts-path ] - [-c|--configuration ] [--force] - [--include-source] [--include-symbols] [--interactive] - [--no-build] [--no-dependencies] [--no-restore] [--nologo] - [-o|--output ] [--runtime ] - [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] + [-c|--configuration ] [--disable-build-servers][--force] [--include-source] [--include-symbols] [--interactive] [--no-build] [--no-dependencies] [--no-restore] [--nologo] [-o|--output ] [--runtime ] [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] [--version-suffix ] dotnet pack -h|--help @@ -64,6 +60,8 @@ You can provide MSBuild properties to the `dotnet pack` command for the packing [!INCLUDE [configuration](../../../includes/cli-configuration-publish-pack.md)] +[!INCLUDE [disable-build-servers](../../../includes/cli-disable-build-servers.md)] + - **`--force`** Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file. @@ -78,7 +76,7 @@ You can provide MSBuild properties to the `dotnet pack` command for the packing Includes the debug symbols NuGet packages in addition to the regular NuGet packages in the output directory. -[!INCLUDE [interactive](../../../includes/cli-interactive-3-0.md)] +[!INCLUDE [interactive](../../../includes/cli-interactive.md)] - **`--no-build`** diff --git a/docs/core/tools/dotnet-package-remove.md b/docs/core/tools/dotnet-package-remove.md index 11fbd48aa8f45..2eaff4372ff48 100644 --- a/docs/core/tools/dotnet-package-remove.md +++ b/docs/core/tools/dotnet-package-remove.md @@ -1,15 +1,15 @@ --- title: dotnet package remove command description: The dotnet package remove command provides a convenient option to remove NuGet package reference to a project. -ms.date: 04/02/2025 +ms.date: 09/29/2025 --- # dotnet package remove -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name -`dotnet package remove` - Removes package reference from a project file. +`dotnet package remove` - Removes a package reference from a project file. > [!NOTE] > If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet remove package`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). @@ -17,7 +17,7 @@ ms.date: 04/02/2025 ## Synopsis ```dotnetcli -dotnet package remove [--project ] +dotnet package remove [--project ] [--interactive] [--file ] dotnet package remove -h|--help ``` @@ -28,16 +28,22 @@ The `dotnet package remove` command provides a convenient option to remove a NuG ## Arguments -`PROJECT` - -Specifies the project file. If not specified, the command searches the current directory for one. - `PACKAGE_NAME` The package reference to remove. ## Options +- **`-p|--project `** + + The project file to operate on. If a solution file is specified, the command will update the package in all projects in the solution that reference it. If not specified, the command will search the current directory for a project file. + +[!INCLUDE [interactive](../../../includes/cli-interactive.md)] + +- **`--file `** + + The file-based app to operate on. + [!INCLUDE [help](../../../includes/cli-help.md)] ## Examples @@ -47,3 +53,9 @@ The package reference to remove. ```dotnetcli dotnet package remove Newtonsoft.Json ``` + +- Remove `Newtonsoft.Json` NuGet package from a specific project file: + + ```dotnetcli + dotnet package remove Newtonsoft.Json --file MyApp.cs + ``` diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index 2ca8374b29b70..31afe86bbfa4b 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -1,7 +1,7 @@ --- title: dotnet restore command description: Learn how to restore dependencies and project-specific tools with the dotnet restore command. -ms.date: 09/24/2025 +ms.date: 09/29/2025 --- # dotnet restore @@ -17,7 +17,7 @@ ms.date: 09/24/2025 dotnet restore [||] [--configfile ] [--disable-build-servers] [--disable-parallel] [-f|--force] [--force-evaluate] [--ignore-failed-sources] - [--interactive] [--lock-file-path ] [--locked-mode] + [--interactive] [--lock-file-path ] [--locked-mode] [--no-http-cache] [--no-cache] [--no-dependencies] [--packages ] [-r|--runtime ] [-s|--source ] [--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]] @@ -124,6 +124,10 @@ There are three specific settings that `dotnet restore` ignores: Don't allow updating project lock file. +- **`--no-http-cache`** + + Disable Http Caching for packages. + - **`--no-cache`** Specifies to not cache HTTP requests. diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index 52d837939bb34..fe09140d4cc79 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -1,7 +1,7 @@ --- title: dotnet run command description: The dotnet run command provides a convenient option to run your application from the source code. -ms.date: 09/24/2025 +ms.date: 09/29/2025 --- # dotnet run @@ -14,13 +14,10 @@ ms.date: 09/24/2025 ## Synopsis ```dotnetcli -dotnet run [] [-a|--arch ] [-c|--configuration ] - [-e|--environment ] [--file ] - [-f|--framework ] [--force] [--interactive] - [--launch-profile ] [--no-build] - [--no-dependencies] [--no-launch-profile] [--no-restore] - [--os ] [--project ] [-r|--runtime ] - [--tl:[auto|on|off]] [-v|--verbosity ] +dotnet run [] [-a|--arch ] [--artifacts-path ] [-c|--configuration ] + [-e|--environment ] [--file ] [-f|--framework ] [--force] [--interactive] + [--launch-profile ] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] + [--os ] [--project ] [-r|--runtime ] [--tl:[auto|on|off]] [-v|--verbosity ] [[--] [application arguments]] dotnet run -h|--help @@ -69,8 +66,12 @@ To run the application, the `dotnet run` command resolves the dependencies of th [!INCLUDE [arch](../../../includes/cli-arch.md)] +[!INCLUDE [artifacts-path](../../../includes/cli-artifacts-path.md)] + [!INCLUDE [configuration](../../../includes/cli-configuration.md)] +[!INCLUDE [disable-build-servers](../../../includes/cli-disable-build-servers.md)] + - **`-e|--environment `** Sets the specified environment variable in the process that will be run by the command. The specified environment variable is *not* applied to the `dotnet run` process. @@ -117,6 +118,10 @@ To run the application, the `dotnet run` command resolves the dependencies of th Doesn't build the project before running. It also implicitly sets the `--no-restore` flag. +- **`--no-cache`** + + Skip up to date checks and always build the program before running. + - **`--no-dependencies`** When restoring a project with project-to-project (P2P) references, restores the root project and not the references. @@ -129,6 +134,10 @@ To run the application, the `dotnet run` command resolves the dependencies of th Doesn't execute an implicit restore when running the command. +- **`--no-self-contained`** + + Publish your application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run your application. + [!INCLUDE [os](../../../includes/cli-os.md)] - **`--project `** @@ -158,6 +167,10 @@ To run the application, the `dotnet run` command resolves the dependencies of th Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). +- **`-sc|--self-contained`** + + Publishes the .NET runtime with your application so the runtime doesn't need to be installed on the target system. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. + [!INCLUDE [tl](../../../includes/cli-tl.md)] [!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)] diff --git a/docs/core/tools/dotnet-store.md b/docs/core/tools/dotnet-store.md index 3316eb07d527a..e618dec48965a 100644 --- a/docs/core/tools/dotnet-store.md +++ b/docs/core/tools/dotnet-store.md @@ -1,11 +1,11 @@ --- title: dotnet store command description: The 'dotnet store' command stores the specified assemblies in the runtime package store. -ms.date: 02/14/2020 +ms.date: 09/29/2025 --- # dotnet store -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name @@ -14,10 +14,10 @@ ms.date: 02/14/2020 ## Synopsis ```dotnetcli -dotnet store -m|--manifest - -f|--framework -r|--runtime +dotnet store [-m|--manifest ] + [-f|--framework ] [--disable-build-servers] [-r|--runtime ] [--framework-version ] [--output ] - [--skip-optimization] [--skip-symbols] [-v|--verbosity ] + [--skip-optimization] [--skip-symbols] [--use-current-runtime, --ucr [true|false]] [-v|--verbosity ] [--working-dir ] dotnet store -h|--help @@ -33,6 +33,8 @@ dotnet store -h|--help Specifies the [target framework](../../standard/frameworks.md). The target framework has to be specified in the project file. +[!INCLUDE [disable-build-servers](../../../includes/cli-disable-build-servers.md)] + - **`-m|--manifest `** The *package store manifest file* is an XML file that contains the list of packages to store. The format of the manifest file is compatible with the SDK-style project format. So, a project file that references the desired packages can be used with the `-m|--manifest` option to store assemblies in the runtime package store. To specify multiple manifest files, repeat the option and path for each file. For example: `--manifest packages1.csproj --manifest packages2.csproj`. @@ -61,6 +63,10 @@ dotnet store -h|--help Skips symbol generation. Currently, you can only generate symbols on Windows and Linux. +- **`--use-current-runtime, --ucr [true|false]`** + + Use current runtime as the target runtime. The default is `false`. + [!INCLUDE [verbosity](../../../includes/cli-verbosity.md)] - **`-w|--working-dir `** diff --git a/docs/core/tools/dotnet-test.md b/docs/core/tools/dotnet-test.md index 062608d4ccc2f..52e41db723b75 100644 --- a/docs/core/tools/dotnet-test.md +++ b/docs/core/tools/dotnet-test.md @@ -1,7 +1,7 @@ --- title: dotnet test command description: The dotnet test command is used to execute unit tests in a given project. -ms.date: 03/27/2024 +ms.date: 09/29/2025 --- # dotnet test @@ -35,7 +35,7 @@ Some examples of the `dotnet.config` file: ### [dotnet test with VSTest](#tab/dotnet-test-with-vstest) -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions #### Synopsis @@ -54,6 +54,7 @@ dotnet test [ | | | | ] [-c|--configuration ] [--collect ] [-d|--diag ] + [--disable-build-servers] [-f|--framework ] [-e|--environment ] [--filter ] @@ -186,6 +187,8 @@ Where `Microsoft.NET.Test.Sdk` is the test host, `xunit` is the test framework. Enables diagnostic mode for the test platform and writes diagnostic messages to the specified file and to files next to it. The process that is logging the messages determines which files are created, such as `*.host_.txt` for test host log, and `*.datacollector_.txt` for data collector log. +[!INCLUDE [disable-build-servers](../../../includes/cli-disable-build-servers.md)] + - **`-e|--environment `** Sets the value of an environment variable. Creates the variable if it does not exist, overrides if it does exist. Use of this option will force the tests to be run in an isolated process. The option can be specified multiple times to provide multiple variables. diff --git a/docs/core/tools/dotnet-watch.md b/docs/core/tools/dotnet-watch.md index 226b48878cd68..92566b828ffe9 100644 --- a/docs/core/tools/dotnet-watch.md +++ b/docs/core/tools/dotnet-watch.md @@ -1,11 +1,11 @@ --- title: dotnet watch command description: The dotnet watch command is a file watcher that runs a dotnet command when changes in source code are detected. -ms.date: 06/03/2024 +ms.date: 09/29/2025 --- # dotnet watch -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name @@ -15,9 +15,11 @@ ms.date: 06/03/2024 ```dotnetcli dotnet watch [] - [--list] + [--artifacts-path ] + [--disable-build-servers] + [--list] [--no-self-contained] [--no-hot-reload] [--non-interactive] - [--project ] + [--project ] [--sc, --self-contained] [-q|--quiet] [-v|--verbose] [--version] [--] @@ -64,6 +66,10 @@ As an alternative to disabling response compression, manually add the browser re ## Options +[!INCLUDE [artifacts-path](../../../includes/cli-artifacts-path.md)] + +[!INCLUDE [disable-build-servers](../../../includes/cli-disable-build-servers.md)] + - **`--list`** Lists all discovered files without starting the watcher. @@ -72,6 +78,10 @@ As an alternative to disabling response compression, manually add the browser re Suppress [hot reload](#hot-reload) for [supported apps](/visualstudio/debugger/hot-reload#supported-net-app-frameworks-and-scenarios). +- **`--no-self-contained`** + + Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application. Available since .NET 6. + - **`--non-interactive`** Runs `dotnet watch` in non-interactive mode. Use this option to prevent console input from being requested. When hot reload is enabled and a [rude edit](#rude-edits) is detected, dotnet watch restarts the app. Available since .NET 7 SDK. @@ -80,6 +90,10 @@ As an alternative to disabling response compression, manually add the browser re Specifies the path of the project file to run (folder only or including the project file name). If not specified, it defaults to the current directory. +- **`-sc|--self-contained`** + + Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `true` if a runtime identifier is specified. Available since .NET 6. + - **`-q|--quiet`** Suppresses all output that is generated by the `dotnet watch` command except warnings and errors. The option is not passed on to child commands. For example, output from `dotnet restore` and `dotnet run` continues to be output. From 4134976fb1911000700ff48bb9ab695141b2ac89 Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Mon, 29 Sep 2025 14:07:23 -0700 Subject: [PATCH 02/12] Update dotnet format documentation for clarity and accuracy --- docs/core/tools/dotnet-format.md | 62 +++++++++++++++++--------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index 6dbffdda791ac..fe489bcff6574 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -1,11 +1,11 @@ --- title: dotnet format command description: The dotnet format command formats code to match EditorConfig settings for the current directory. -ms.date: 07/12/2021 +ms.date: 09/29/2025 --- # dotnet format -**This article applies to:** ✔️ .NET 6.x SDK and later versions +**This article applies to:** ✔️ .NET 6 and later versions ## Name @@ -14,7 +14,7 @@ ms.date: 07/12/2021 ## Synopsis ```dotnetcli -dotnet format [] [command] [options] +dotnet format [] [--diagnostics ] [--exclude-diagnostics ] [--severity ] [--no-restore] [--verify-no-changes] [--include ] [--exclude ] [--include-generated] [-v|--verbosity ] [--binarylog ] [--report ] [--version] dotnet format -h|--help ``` @@ -33,49 +33,55 @@ The MSBuild project or solution to run code formatting on. If a project or solut None of the options below are required for the `dotnet format` command to succeed, but you can use them to further customize what is formatted and by which rules. -* **`--diagnostics `** +- **`--diagnostics `** A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). -* **`--severity`** +- **`--exclude-diagnostics `** + + A space-separated list of diagnostic IDs to exclude when fixing code style or third-party issues. Default value is none. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). + +- **`--severity`** The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. -* **`--no-restore`** +- **`--no-restore`** Doesn't execute an implicit restore before formatting. Default is to do implicit restore. -* **`--verify-no-changes`** +- **`--verify-no-changes`** Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted. -* **`--include `** +- **`--include `** A space-separated list of relative file or folder paths to include in formatting. The default is all files in the solution or project. -* **`--exclude `** +- **`--exclude `** A space-separated list of relative file or folder paths to exclude from formatting. The default is none. -* **`--include-generated`** +- **`--include-generated`** Formats files generated by the SDK. -* **`-v|--verbosity `** +- **`-v|--verbosity `** Sets the verbosity level. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. Default value is `m[inimal]`. -* **`--binarylog `** +- **`--binarylog `** Logs all project or solution load information to a binary log file. -* **`--report `** +- **`--report `** Produces a JSON report in the directory specified by ``. -* **`-h|--help`** +- **`--version`** + + Displays version information. - Shows help and usage information +[!INCLUDE [help](../../../includes/cli-help.md)] ## Subcommands @@ -89,7 +95,7 @@ The `dotnet format whitespace` subcommand only runs formatting rules associated #### Options -* **`--folder`** +- **`--folder`** Treat the `` argument as a path to a simple folder of code files. @@ -103,11 +109,11 @@ The `dotnet format style` subcommand only runs formatting rules associated with #### Options -* **`--diagnostics `** +- **`--diagnostics `** A space-separated list of diagnostic IDs to use as a filter when fixing code style issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in code style analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). -* **`--severity`** +- **`--severity`** The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn` @@ -121,59 +127,59 @@ The `dotnet format analyzers` subcommand only runs formatting rules associated w ##### Options -* **`--diagnostics `** +- **`--diagnostics `** A space-separated list of diagnostic IDs to use as a filter when fixing non code style issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for quality rules](../../fundamentals/code-analysis/quality-rules/index.md). For third-party analyzers refer to their documentation. -* **`--severity`** +- **`--severity`** The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. ## Examples -* Format all code in the solution: +- Format all code in the solution: ```dotnetcli dotnet format ./solution.sln ``` -* Clean up all code in the application project: +- Clean up all code in the application project: ```dotnetcli dotnet format ./src/application.csproj ``` -* Verify that all code is correctly formatted: +- Verify that all code is correctly formatted: ```dotnetcli dotnet format --verify-no-changes ``` -* Clean up all code in the *src* and *tests* directory but not in *src/submodule-a*: +- Clean up all code in the *src* and *tests* directory but not in *src/submodule-a*: ```dotnetcli dotnet format --include ./src/ ./tests/ --exclude ./src/submodule-a/ ``` -* Fix a specific **code style** issue: +- Fix a specific **code style** issue: ```dotnetcli dotnet format style --diagnostics IDE0005 --severity info ``` -* Fix all **code style** issues that have severity `info`, `warning` or `error`: +- Fix all **code style** issues that have severity `info`, `warning` or `error`: ```dotnetcli dotnet format style --severity info ``` -* Fix a specific (non code style) analyzer issue: +- Fix a specific (non code style) analyzer issue: ```dotnetcli dotnet format analyzers --diagnostics CA1831 --severity warn ``` -* Fix all non code style issues that have severity `info`, `warning` or `error`: +- Fix all non code style issues that have severity `info`, `warning` or `error`: ```dotnetcli dotnet format analyzers --severity info From 272c3c774fdb776f5c0c847c6c030c16fdf42ef3 Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Mon, 29 Sep 2025 16:29:27 -0700 Subject: [PATCH 03/12] update options list format --- docs/core/tools/dotnet-format.md | 3 ++- docs/core/tools/dotnet-pack.md | 3 ++- docs/core/tools/dotnet-package-remove.md | 3 ++- docs/core/tools/dotnet-run.md | 3 ++- docs/core/tools/dotnet-store.md | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index fe489bcff6574..a8d852e3656ea 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -14,7 +14,8 @@ ms.date: 09/29/2025 ## Synopsis ```dotnetcli -dotnet format [] [--diagnostics ] [--exclude-diagnostics ] [--severity ] [--no-restore] [--verify-no-changes] [--include ] [--exclude ] [--include-generated] [-v|--verbosity ] [--binarylog ] [--report ] [--version] +dotnet format [] + [--diagnostics ] [--exclude-diagnostics ] [--severity ] [--no-restore] [--verify-no-changes] [--include ] [--exclude ] [--include-generated] [-v|--verbosity ] [--binarylog ] [--report ] [--version] dotnet format -h|--help ``` diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index 0a413748ac6d8..f157f3ef59a75 100644 --- a/docs/core/tools/dotnet-pack.md +++ b/docs/core/tools/dotnet-pack.md @@ -14,7 +14,8 @@ ms.date: 09/29/2025 ## Synopsis ```dotnetcli -dotnet pack [|] [--artifacts-path ] +dotnet pack [|] + [--artifacts-path ] [-c|--configuration ] [--disable-build-servers][--force] [--include-source] [--include-symbols] [--interactive] [--no-build] [--no-dependencies] [--no-restore] [--nologo] [-o|--output ] [--runtime ] [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] [--version-suffix ] diff --git a/docs/core/tools/dotnet-package-remove.md b/docs/core/tools/dotnet-package-remove.md index 2eaff4372ff48..5d9a069395f3c 100644 --- a/docs/core/tools/dotnet-package-remove.md +++ b/docs/core/tools/dotnet-package-remove.md @@ -17,7 +17,8 @@ ms.date: 09/29/2025 ## Synopsis ```dotnetcli -dotnet package remove [--project ] [--interactive] [--file ] +dotnet package remove [--project ] + [--interactive] [--file ] dotnet package remove -h|--help ``` diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index fe09140d4cc79..588dbd4913505 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -14,7 +14,8 @@ ms.date: 09/29/2025 ## Synopsis ```dotnetcli -dotnet run [] [-a|--arch ] [--artifacts-path ] [-c|--configuration ] +dotnet run [] + [-a|--arch ] [--artifacts-path ] [-c|--configuration ] [-e|--environment ] [--file ] [-f|--framework ] [--force] [--interactive] [--launch-profile ] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] [--os ] [--project ] [-r|--runtime ] [--tl:[auto|on|off]] [-v|--verbosity ] diff --git a/docs/core/tools/dotnet-store.md b/docs/core/tools/dotnet-store.md index e618dec48965a..d61fc5123b20d 100644 --- a/docs/core/tools/dotnet-store.md +++ b/docs/core/tools/dotnet-store.md @@ -17,7 +17,7 @@ ms.date: 09/29/2025 dotnet store [-m|--manifest ] [-f|--framework ] [--disable-build-servers] [-r|--runtime ] [--framework-version ] [--output ] - [--skip-optimization] [--skip-symbols] [--use-current-runtime, --ucr [true|false]] [-v|--verbosity ] + [--skip-optimization] [--skip-symbols] [-ucr|--use-current-runtime] [-v|--verbosity ] [--working-dir ] dotnet store -h|--help @@ -63,7 +63,7 @@ dotnet store -h|--help Skips symbol generation. Currently, you can only generate symbols on Windows and Linux. -- **`--use-current-runtime, --ucr [true|false]`** +- **`-ucr|--use-current-runtime`** Use current runtime as the target runtime. The default is `false`. From 65ccc2dfc7d60f8c8b6e986390f63b948858e5fb Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Mon, 29 Sep 2025 16:41:46 -0700 Subject: [PATCH 04/12] reduce spacing for command options list --- docs/core/tools/dotnet-format.md | 2 +- docs/core/tools/dotnet-pack.md | 6 +++--- docs/core/tools/dotnet-package-remove.md | 2 +- docs/core/tools/dotnet-restore.md | 14 ++++++-------- docs/core/tools/dotnet-run.md | 9 ++++----- docs/core/tools/dotnet-store.md | 8 ++++---- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index a8d852e3656ea..49bc245a0dd2a 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -15,7 +15,7 @@ ms.date: 09/29/2025 ```dotnetcli dotnet format [] - [--diagnostics ] [--exclude-diagnostics ] [--severity ] [--no-restore] [--verify-no-changes] [--include ] [--exclude ] [--include-generated] [-v|--verbosity ] [--binarylog ] [--report ] [--version] + [--diagnostics ] [--exclude-diagnostics ] [--severity ] [--no-restore] [--verify-no-changes] [--include ] [--exclude ] [--include-generated] [-v|--verbosity ] [--binarylog ] [--report ] [--version] dotnet format -h|--help ``` diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index f157f3ef59a75..1d99289c3d5e8 100644 --- a/docs/core/tools/dotnet-pack.md +++ b/docs/core/tools/dotnet-pack.md @@ -15,9 +15,9 @@ ms.date: 09/29/2025 ```dotnetcli dotnet pack [|] - [--artifacts-path ] - [-c|--configuration ] [--disable-build-servers][--force] [--include-source] [--include-symbols] [--interactive] [--no-build] [--no-dependencies] [--no-restore] [--nologo] [-o|--output ] [--runtime ] [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] - [--version-suffix ] + [--artifacts-path ] + [-c|--configuration ] [--disable-build-servers][--force] [--include-source] [--include-symbols] [--interactive] [--no-build] [--no-dependencies] [--no-restore] [--nologo] [-o|--output ] [--runtime ] [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] + [--version-suffix ] dotnet pack -h|--help ``` diff --git a/docs/core/tools/dotnet-package-remove.md b/docs/core/tools/dotnet-package-remove.md index 5d9a069395f3c..28f45ba5c12f1 100644 --- a/docs/core/tools/dotnet-package-remove.md +++ b/docs/core/tools/dotnet-package-remove.md @@ -18,7 +18,7 @@ ms.date: 09/29/2025 ```dotnetcli dotnet package remove [--project ] - [--interactive] [--file ] + [--interactive] [--file ] dotnet package remove -h|--help ``` diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index 31afe86bbfa4b..7a648c4594a43 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -14,14 +14,12 @@ ms.date: 09/29/2025 ## Synopsis ```dotnetcli -dotnet restore [||] [--configfile ] [--disable-build-servers] - [--disable-parallel] - [-f|--force] [--force-evaluate] [--ignore-failed-sources] - [--interactive] [--lock-file-path ] [--locked-mode] [--no-http-cache] - [--no-cache] [--no-dependencies] [--packages ] - [-r|--runtime ] [-s|--source ] - [--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]] - [--use-lock-file] [-a|--arch ] [--os ] [-v|--verbosity ] +dotnet restore [||] + [--configfile ] [--disable-build-servers] + [--disable-parallel] [-f|--force] [--force-evaluate] [--ignore-failed-sources] [--interactive] [--lock-file-path ] [--locked-mode] [--no-http-cache] + [--no-cache] [--no-dependencies] [--packages ] + [-r|--runtime ] [-s|--source ] + [--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]] [--use-lock-file] [-a|--arch ] [--os ] [-v|--verbosity ] dotnet restore -h|--help ``` diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index 588dbd4913505..5439aee3478a2 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -15,11 +15,10 @@ ms.date: 09/29/2025 ```dotnetcli dotnet run [] - [-a|--arch ] [--artifacts-path ] [-c|--configuration ] - [-e|--environment ] [--file ] [-f|--framework ] [--force] [--interactive] - [--launch-profile ] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] - [--os ] [--project ] [-r|--runtime ] [--tl:[auto|on|off]] [-v|--verbosity ] - [[--] [application arguments]] + [-a|--arch ] [--artifacts-path ] [-c|--configuration ] + [-e|--environment ] [--file ] [-f|--framework ] [--force] [--interactive] + [--launch-profile ] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] + [--os ] [--project ] [-r|--runtime ] [--tl:[auto|on|off]] [-v|--verbosity ] [[--] [application arguments]] dotnet run -h|--help ``` diff --git a/docs/core/tools/dotnet-store.md b/docs/core/tools/dotnet-store.md index d61fc5123b20d..0e05af1fb4a83 100644 --- a/docs/core/tools/dotnet-store.md +++ b/docs/core/tools/dotnet-store.md @@ -15,10 +15,10 @@ ms.date: 09/29/2025 ```dotnetcli dotnet store [-m|--manifest ] - [-f|--framework ] [--disable-build-servers] [-r|--runtime ] - [--framework-version ] [--output ] - [--skip-optimization] [--skip-symbols] [-ucr|--use-current-runtime] [-v|--verbosity ] - [--working-dir ] + [-f|--framework ] [--disable-build-servers] [-r|--runtime ] + [--framework-version ] [--output ] + [--skip-optimization] [--skip-symbols] [-ucr|--use-current-runtime] [-v|--verbosity ] + [--working-dir ] dotnet store -h|--help ``` From b92c74f3a555c6daf01bf919cf9dc3e7c0ca3b3c Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Tue, 30 Sep 2025 10:49:19 -0700 Subject: [PATCH 05/12] Specify .NET 6 SDK as minimum version and update options --- docs/core/tools/dotnet-build.md | 34 ++++++++-------- docs/core/tools/dotnet-clean.md | 2 +- docs/core/tools/dotnet-dev-certs.md | 15 +++---- docs/core/tools/dotnet-format.md | 52 +++++++++++++----------- docs/core/tools/dotnet-msbuild.md | 2 +- docs/core/tools/dotnet-pack.md | 13 +++--- docs/core/tools/dotnet-package-remove.md | 14 +++---- docs/core/tools/dotnet-restore.md | 49 +++++++++++----------- docs/core/tools/dotnet-run.md | 19 +++++---- docs/core/tools/dotnet-sdk-check.md | 2 +- docs/core/tools/dotnet-store.md | 16 ++++---- docs/core/tools/dotnet-test.md | 4 +- docs/core/tools/dotnet-watch.md | 29 +++++++------ 13 files changed, 129 insertions(+), 122 deletions(-) diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index d4ac620eb2725..3d734cb69eddc 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -5,7 +5,7 @@ ms.date: 09/24/2025 --- # dotnet build -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -16,15 +16,13 @@ ms.date: 09/24/2025 ```dotnetcli dotnet build [||] [-a|--arch ] [--artifacts-path ] - [-c|--configuration ] [-f|--framework ] - [--disable-build-servers] - [--force] [--interactive] [--no-dependencies] [--no-incremental] - [--no-restore] [--nologo] [--no-self-contained] [--os ] - [-o|--output ] - [-p|--property:=] - [-r|--runtime ] - [-sc|--self-contained [true|false]] [--source ] - [--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]] + [-c|--configuration ] [--disable-build-servers] + [-f|--framework ] [--force] [--interactive] + [--no-dependencies] [--no-incremental] [--no-restore] [--nologo] + [--no-self-contained] [-o|--output ] [--os ] + [-p|--property:=] [-r|--runtime ] + [--sc|--self-contained] [--source ] + [--tl:[auto|on|off]] [ --ucr|--use-current-runtime] [-v|--verbosity ] [--version-suffix ] dotnet build -h|--help @@ -95,8 +93,6 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file. -[!INCLUDE [help](../../../includes/cli-help.md)] - [!INCLUDE [interactive](../../../includes/cli-interactive-3-0.md)] - **`--no-dependencies`** @@ -142,9 +138,9 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev 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`** - Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `true` if a runtime identifier is specified. Available since .NET 6. + Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. Available since .NET 6 SDK. - **`--source `** @@ -152,18 +148,20 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev [!INCLUDE [tl](../../../includes/cli-tl.md)] -- **`-v|--verbosity `** +- **`--ucr|--use-current-runtime`** - Sets the verbosity level of the command. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. The default is `minimal`. By default, MSBuild displays warnings and errors at all verbosity levels. To exclude warnings, use `/property:WarningLevel=0`. For more information, see and [WarningLevel](../../csharp/language-reference/compiler-options/errors-warnings.md#warninglevel). + Use current runtime as the target runtime. The default is `false`. -- **`--use-current-runtime, --ucr [true|false]`** +- **`-v|--verbosity `** - Sets the `RuntimeIdentifier` to a platform portable `RuntimeIdentifier` based on the one of your machine. This happens implicitly with properties that require a `RuntimeIdentifier`, such as `SelfContained`, `PublishAot`, `PublishSelfContained`, `PublishSingleFile`, and `PublishReadyToRun`. If the property is set to false, that implicit resolution will no longer occur. + Sets the verbosity level of the command. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. The default is `minimal`. By default, MSBuild displays warnings and errors at all verbosity levels. To exclude warnings, use `/property:WarningLevel=0`. For more information, see and [WarningLevel](../../csharp/language-reference/compiler-options/errors-warnings.md#warninglevel). - **`--version-suffix `** Sets the value of the `$(VersionSuffix)` property to use when building the project. This only works if the `$(Version)` property isn't set. Then, `$(Version)` is set to the `$(VersionPrefix)` combined with the `$(VersionSuffix)`, separated by a dash. +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Examples - Build a project and its dependencies: diff --git a/docs/core/tools/dotnet-clean.md b/docs/core/tools/dotnet-clean.md index b2c8104351c73..752e8745c3bce 100644 --- a/docs/core/tools/dotnet-clean.md +++ b/docs/core/tools/dotnet-clean.md @@ -5,7 +5,7 @@ ms.date: 09/24/2025 --- # dotnet clean -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name diff --git a/docs/core/tools/dotnet-dev-certs.md b/docs/core/tools/dotnet-dev-certs.md index 1e3c9d9341b0b..1b5b6f4707fed 100644 --- a/docs/core/tools/dotnet-dev-certs.md +++ b/docs/core/tools/dotnet-dev-certs.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet dev-certs -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,10 +15,11 @@ ms.date: 09/29/2025 ```dotnetcli dotnet dev-certs https - [-c|--check] [--clean] [-ep|--export-path ] + [-c|--check] [--check-trust-machine-readable] + [--clean] [-ep|--export-path ] [--format] [-i|--import] [-np|--no-password] [-p|--password] [-q|--quiet] [-t|--trust] - [-v|--verbose] [--version] [--check-trust-machine-readable] + [-v|--verbose] [--version] dotnet dev-certs https -h|--help ``` @@ -61,6 +62,10 @@ The `dotnet dev-certs` command manages a self-signed certificate to enable HTTPS Checks for the existence of the development certificate but doesn't perform any action. Use this option with the `--trust` option to check if the certificate is not only valid but also trusted. +- **`--check-trust-machine-readable`** + + Same as running `--check --trust`, but outputs the results in json. + - **`--clean`** Removes all HTTPS development certificates from the certificate store by using the .NET certificate store API. Doesn't remove any physical files that were created by using the `--export-path` option. On macOS in .NET 7.0, the `dotnet dev-certs` command creates the certificate on a path on disk, and the clean operation removes that certificate file. @@ -140,10 +145,6 @@ The `dotnet dev-certs` command manages a self-signed certificate to enable HTTPS Display debug information. -- **`--check-trust-machine-readable`** - - Same as running `--check --trust`, but outputs the results in json. - ## Examples - Check for the presence of a development certificate, and create one in the default certificate store if one doesn't exist yet. But don't trust the certificate. diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index 49bc245a0dd2a..7ef49a1ea7675 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet format -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,7 +15,11 @@ ms.date: 09/29/2025 ```dotnetcli dotnet format [] - [--diagnostics ] [--exclude-diagnostics ] [--severity ] [--no-restore] [--verify-no-changes] [--include ] [--exclude ] [--include-generated] [-v|--verbosity ] [--binarylog ] [--report ] [--version] + [--binarylog ] [--diagnostics ] + [--exclude ] [--exclude-diagnostics ] + [--include ] [--include-generated] + [--no-restore] [--report ] [--severity ] + [-v|--verbosity ] [--verify-no-changes] [--version] dotnet format -h|--help ``` @@ -34,54 +38,54 @@ The MSBuild project or solution to run code formatting on. If a project or solut None of the options below are required for the `dotnet format` command to succeed, but you can use them to further customize what is formatted and by which rules. -- **`--diagnostics `** - - A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). - -- **`--exclude-diagnostics `** +- **`--binarylog `** - A space-separated list of diagnostic IDs to exclude when fixing code style or third-party issues. Default value is none. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). + Logs all project or solution load information to a binary log file. -- **`--severity`** +- **`--diagnostics `** - The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. + A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). -- **`--no-restore`** +- **`--exclude `** - Doesn't execute an implicit restore before formatting. Default is to do implicit restore. + A space-separated list of relative file or folder paths to exclude from formatting. The default is none. -- **`--verify-no-changes`** +- **`--exclude-diagnostics `** - Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted. + A space-separated list of diagnostic IDs to exclude when fixing code style or third-party issues. Default value is none. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). - **`--include `** A space-separated list of relative file or folder paths to include in formatting. The default is all files in the solution or project. -- **`--exclude `** - - A space-separated list of relative file or folder paths to exclude from formatting. The default is none. - - **`--include-generated`** Formats files generated by the SDK. -- **`-v|--verbosity `** - - Sets the verbosity level. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. Default value is `m[inimal]`. - -- **`--binarylog `** +- **`--no-restore`** - Logs all project or solution load information to a binary log file. + Doesn't execute an implicit restore before formatting. Default is to do implicit restore. - **`--report `** Produces a JSON report in the directory specified by ``. +- **`--severity`** + + The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. + +- **`--verify-no-changes`** + + Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted. + - **`--version`** Displays version information. +- **`-v|--verbosity `** + + Sets the verbosity level. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. Default value is `m[inimal]`. + [!INCLUDE [help](../../../includes/cli-help.md)] ## Subcommands diff --git a/docs/core/tools/dotnet-msbuild.md b/docs/core/tools/dotnet-msbuild.md index 6342ff8190ff6..20ceb31520d12 100644 --- a/docs/core/tools/dotnet-msbuild.md +++ b/docs/core/tools/dotnet-msbuild.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet msbuild -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index 1d99289c3d5e8..b1db4d6dbc5f4 100644 --- a/docs/core/tools/dotnet-pack.md +++ b/docs/core/tools/dotnet-pack.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet pack -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,8 +15,11 @@ ms.date: 09/29/2025 ```dotnetcli dotnet pack [|] - [--artifacts-path ] - [-c|--configuration ] [--disable-build-servers][--force] [--include-source] [--include-symbols] [--interactive] [--no-build] [--no-dependencies] [--no-restore] [--nologo] [-o|--output ] [--runtime ] [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] + [--artifacts-path ] [-c|--configuration ] + [--disable-build-servers] [--force] [--include-source] [--include-symbols] + [--interactive] [--no-build] [--no-dependencies] [--no-restore] [--nologo] + [-o|--output ] [--runtime ] + [-s|--serviceable] [--tl:[auto|on|off]] [-v|--verbosity ] [--version-suffix ] dotnet pack -h|--help @@ -67,8 +70,6 @@ You can provide MSBuild properties to the `dotnet pack` command for the packing Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file. -[!INCLUDE [help](../../../includes/cli-help.md)] - - **`--include-source`** Includes the debug symbols NuGet packages in addition to the regular NuGet packages in the output directory. The sources files are included in the `src` folder within the symbols package. @@ -131,6 +132,8 @@ You can provide MSBuild properties to the `dotnet pack` command for the packing If `Version` has a value and you pass `--version-suffix` to `dotnet pack`, the value specified for `--version-suffix` is ignored. +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Examples - Pack the project in the current directory: diff --git a/docs/core/tools/dotnet-package-remove.md b/docs/core/tools/dotnet-package-remove.md index 28f45ba5c12f1..3c3d77f2421bb 100644 --- a/docs/core/tools/dotnet-package-remove.md +++ b/docs/core/tools/dotnet-package-remove.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet package remove -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -17,8 +17,8 @@ ms.date: 09/29/2025 ## Synopsis ```dotnetcli -dotnet package remove [--project ] - [--interactive] [--file ] +dotnet package remove + [--file ] [--interactive] [--project ] dotnet package remove -h|--help ``` @@ -35,15 +35,15 @@ The package reference to remove. ## Options -- **`-p|--project `** +- **`--file `** - The project file to operate on. If a solution file is specified, the command will update the package in all projects in the solution that reference it. If not specified, the command will search the current directory for a project file. + The file-based app to operate on. [!INCLUDE [interactive](../../../includes/cli-interactive.md)] -- **`--file `** +- **`-p|--project `** - The file-based app to operate on. + The project file to operate on. If a solution file is specified, the command will update the package in all projects in the solution that reference it. If not specified, the command will search the current directory for a project file. [!INCLUDE [help](../../../includes/cli-help.md)] diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index 7a648c4594a43..57a40c64121b2 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet restore -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,11 +15,14 @@ ms.date: 09/29/2025 ```dotnetcli dotnet restore [||] - [--configfile ] [--disable-build-servers] - [--disable-parallel] [-f|--force] [--force-evaluate] [--ignore-failed-sources] [--interactive] [--lock-file-path ] [--locked-mode] [--no-http-cache] - [--no-cache] [--no-dependencies] [--packages ] + [-a|--arch ] [--configfile ] [--disable-build-servers] + [--disable-parallel] [-f|--force] [--force-evaluate] + [--ignore-failed-sources] [--interactive] [--lock-file-path ] + [--locked-mode] [--no-cache] [--no-dependencies] [--no-http-cache] + [--os ] [--packages ] [-r|--runtime ] [-s|--source ] - [--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]] [--use-lock-file] [-a|--arch ] [--os ] [-v|--verbosity ] + [--tl:[auto|on|off]] [--ucr|--use-current-runtime] [--use-lock-file] + [-v|--verbosity ] dotnet restore -h|--help ``` @@ -106,8 +109,6 @@ There are three specific settings that `dotnet restore` ignores: Forces restore to reevaluate all dependencies even if a lock file already exists. -[!INCLUDE [help](../../../includes/cli-help.md)] - - **`--ignore-failed-sources`** Only warn about failed sources if there are packages meeting the version requirement. @@ -122,10 +123,6 @@ There are three specific settings that `dotnet restore` ignores: Don't allow updating project lock file. -- **`--no-http-cache`** - - Disable Http Caching for packages. - - **`--no-cache`** Specifies to not cache HTTP requests. @@ -134,6 +131,16 @@ There are three specific settings that `dotnet restore` ignores: When restoring a project with project-to-project (P2P) references, restores the root project and not the references. +- **`--no-http-cache`** + + Disable Http Caching for packages. + +- **`--os`** + + Specifies the target operating system (OS). This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a `win-x64` machine, specifying `--os linux` sets the RID to `linux-x64`. + + Introduced in .NET SDK 10.0.100 + - **`--packages `** Specifies the directory for restored packages. @@ -146,30 +153,20 @@ There are three specific settings that `dotnet restore` ignores: Specifies the URI of the NuGet package source to use during the restore operation. This setting overrides all of the sources specified in the *nuget.config* files. Multiple sources can be provided by specifying this option multiple times. -[!INCLUDE [tl](../../../includes/cli-tl.md)] - -- **`--use-current-runtime, --ucr [true|false]`** +- **`-ucr|--use-current-runtime`** - Sets the `RuntimeIdentifier` to a platform portable `RuntimeIdentifier` based on the one of your machine. This happens implicitly with properties that require a `RuntimeIdentifier`, such as `SelfContained`, `PublishAot`, `PublishSelfContained`, `PublishSingleFile`, and `PublishReadyToRun`. If the property is set to false, that implicit resolution will no longer occur. + Use current runtime as the target runtime. The default is `false`. - **`--use-lock-file`** Enables project lock file to be generated and used with restore. -- **`-a|--arch`** - - Specifies the target architecture.This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a `win-x64` machine, specifying `--arch arm64` sets the RID to `win-arm64`. - - Introduced in .NET SDK 8.0.100 - -- **`--os`** - - Specifies the target operating system (OS).This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a `win-x64` machine, specifying `--os linux` sets the RID to `linux-x64`. - - Introduced in .NET SDK 10.0.100 +[!INCLUDE [tl](../../../includes/cli-tl.md)] [!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)] +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Examples - Restore dependencies and tools for the project in the current directory: diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index 5439aee3478a2..6d1b6e137bc2e 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet run -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,10 +15,13 @@ ms.date: 09/29/2025 ```dotnetcli dotnet run [] - [-a|--arch ] [--artifacts-path ] [-c|--configuration ] - [-e|--environment ] [--file ] [-f|--framework ] [--force] [--interactive] - [--launch-profile ] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] - [--os ] [--project ] [-r|--runtime ] [--tl:[auto|on|off]] [-v|--verbosity ] [[--] [application arguments]] + [-a|--arch ] [--artifacts-path ] + [-c|--configuration ] [-e|--environment ] + [--file ] [-f|--framework ] [--force] [--interactive] + [--launch-profile ] [--no-build] [--no-dependencies] + [--no-launch-profile] [--no-restore] [--os ] [--project ] + [-r|--runtime ] [--tl:[auto|on|off]] + [-v|--verbosity ] [[--] [application arguments]] dotnet run -h|--help ``` @@ -106,8 +109,6 @@ To run the application, the `dotnet run` command resolves the dependencies of th Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file. -[!INCLUDE [help](../../../includes/cli-help.md)] - [!INCLUDE [interactive](../../../includes/cli-interactive-3-0.md)] - **`--launch-profile `** @@ -144,7 +145,7 @@ To run the application, the `dotnet run` command resolves the dependencies of th Specifies the path of the project file to run (folder name or full path). If not specified, it defaults to the current directory. - The [`-p` abbreviation for `--project` is deprecated](../compatibility/sdk/6.0/deprecate-p-option-dotnet-run.md) starting in .NET 6 SDK. For a limited time starting in .NET 6 RC1 SDK, `-p` can still be used for `--project` despite the deprecation warning. If the argument provided for the option doesn't contain `=`, the command accepts `-p` as short for `--project`. Otherwise, the command assumes that `-p` is short for `--property`. This flexible use of `-p` for `--project` will be phased out in .NET 7. + The [`-p` abbreviation for `--project` is deprecated](../compatibility/sdk/6.0/deprecate-p-option-dotnet-run.md) starting in .NET 6 SDK SDK. For a limited time starting in .NET 6 SDK RC1 SDK, `-p` can still be used for `--project` despite the deprecation warning. If the argument provided for the option doesn't contain `=`, the command accepts `-p` as short for `--project`. Otherwise, the command assumes that `-p` is short for `--property`. This flexible use of `-p` for `--project` will be phased out in .NET 7. - **`--property:=`** @@ -175,6 +176,8 @@ To run the application, the `dotnet run` command resolves the dependencies of th [!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)] +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Environment variables There are four mechanisms by which environment variables can be applied to the launched application: diff --git a/docs/core/tools/dotnet-sdk-check.md b/docs/core/tools/dotnet-sdk-check.md index a694053d7ea29..3b8eddb8b9ffb 100644 --- a/docs/core/tools/dotnet-sdk-check.md +++ b/docs/core/tools/dotnet-sdk-check.md @@ -5,7 +5,7 @@ ms.date: 06/30/2021 --- # dotnet sdk check -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name diff --git a/docs/core/tools/dotnet-store.md b/docs/core/tools/dotnet-store.md index 0e05af1fb4a83..c792997fe5d7f 100644 --- a/docs/core/tools/dotnet-store.md +++ b/docs/core/tools/dotnet-store.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet store -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,9 +15,11 @@ ms.date: 09/29/2025 ```dotnetcli dotnet store [-m|--manifest ] - [-f|--framework ] [--disable-build-servers] [-r|--runtime ] - [--framework-version ] [--output ] - [--skip-optimization] [--skip-symbols] [-ucr|--use-current-runtime] [-v|--verbosity ] + [-f|--framework ] [--disable-build-servers] + [--framework-version ] + [--output ] [-r|--runtime ] + [--skip-optimization] [--skip-symbols] + [--ucr|--use-current-runtime] [-v|--verbosity ] [--working-dir ] dotnet store -h|--help @@ -49,8 +51,6 @@ dotnet store -h|--help Specifies the .NET SDK version. This option enables you to select a specific framework version beyond the framework specified by the `-f|--framework` option. -[!INCLUDE [help](../../../includes/cli-help.md)] - - **`-o|--output `** Specifies the path to the runtime package store. If not specified, it defaults to the *store* subdirectory of the user profile .NET installation directory. @@ -63,7 +63,7 @@ dotnet store -h|--help Skips symbol generation. Currently, you can only generate symbols on Windows and Linux. -- **`-ucr|--use-current-runtime`** +- **`--ucr|--use-current-runtime`** Use current runtime as the target runtime. The default is `false`. @@ -73,6 +73,8 @@ dotnet store -h|--help The working directory used by the command. If not specified, it uses the *obj* subdirectory of the current directory. +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Examples - Store the packages specified in the *packages.csproj* project file for .NET 6.0.1: diff --git a/docs/core/tools/dotnet-test.md b/docs/core/tools/dotnet-test.md index 52e41db723b75..39aa0b95a63eb 100644 --- a/docs/core/tools/dotnet-test.md +++ b/docs/core/tools/dotnet-test.md @@ -5,6 +5,8 @@ ms.date: 09/29/2025 --- # dotnet test +**This article applies to:** ✔️ .NET 6 SDK and later versions + ## Name `dotnet test` - .NET test driver used to execute unit tests. @@ -35,8 +37,6 @@ Some examples of the `dotnet.config` file: ### [dotnet test with VSTest](#tab/dotnet-test-with-vstest) -**This article applies to:** ✔️ .NET 6 and later versions - #### Synopsis ```dotnetcli diff --git a/docs/core/tools/dotnet-watch.md b/docs/core/tools/dotnet-watch.md index 92566b828ffe9..0a2883c43d5f1 100644 --- a/docs/core/tools/dotnet-watch.md +++ b/docs/core/tools/dotnet-watch.md @@ -5,7 +5,7 @@ ms.date: 09/29/2025 --- # dotnet watch -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -15,13 +15,10 @@ ms.date: 09/29/2025 ```dotnetcli dotnet watch [] - [--artifacts-path ] - [--disable-build-servers] - [--list] [--no-self-contained] - [--no-hot-reload] [--non-interactive] - [--project ] [--sc, --self-contained] - [-q|--quiet] [-v|--verbose] - [--version] + [--artifacts-path ] [--disable-build-servers] + [--list] [--no-hot-reload] [--no-self-contained] + [--non-interactive] [--project ] [--sc|--self-contained] + [-q|--quiet] [-v|--verbose] [--version] [--] dotnet watch -?|-h|--help @@ -74,13 +71,13 @@ As an alternative to disabling response compression, manually add the browser re Lists all discovered files without starting the watcher. -- **`--no-hot-reload`** +- **`--no-self-contained`** - Suppress [hot reload](#hot-reload) for [supported apps](/visualstudio/debugger/hot-reload#supported-net-app-frameworks-and-scenarios). + Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application. Available since .NET 6 SDK. -- **`--no-self-contained`** +- **`--no-hot-reload`** - Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application. Available since .NET 6. + Suppress [hot reload](#hot-reload) for [supported apps](/visualstudio/debugger/hot-reload#supported-net-app-frameworks-and-scenarios). - **`--non-interactive`** @@ -90,9 +87,9 @@ As an alternative to disabling response compression, manually add the browser re Specifies the path of the project file to run (folder only or including the project file name). If not specified, it defaults to the current directory. -- **`-sc|--self-contained`** +- **`--sc|--self-contained`** - Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `true` if a runtime identifier is specified. Available since .NET 6. + Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. Available since .NET 6 SDK. - **`-q|--quiet`** @@ -110,6 +107,8 @@ As an alternative to disabling response compression, manually add the browser re The [double-dash option ('--')](../../standard/commandline/syntax.md#the----token) can be used to delimit `dotnet watch` options from arguments that will be passed to the child process. Its use is optional. When the double-dash option isn't used, `dotnet watch` considers the first unrecognized argument to be the beginning of arguments that it should pass into the child `dotnet` process. +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Environment variables `dotnet watch` uses the following environment variables: @@ -225,7 +224,7 @@ More files can be watched by adding items to the `Watch` group. For example, the ## Hot Reload -Starting in .NET 6, `dotnet watch` includes support for *hot reload*. Hot reload is a feature that lets you apply changes to a running app without having to rebuild and restart it. The changes may be to code files or static assets, such as stylesheet files and JavaScript files. This feature streamlines the local development experience, as it gives immediate feedback when you modify your app. +Starting in .NET 6 SDK, `dotnet watch` includes support for *hot reload*. Hot reload is a feature that lets you apply changes to a running app without having to rebuild and restart it. The changes may be to code files or static assets, such as stylesheet files and JavaScript files. This feature streamlines the local development experience, as it gives immediate feedback when you modify your app. For information about app types and .NET versions that support hot reload, see [Supported .NET app frameworks and scenarios](/visualstudio/debugger/hot-reload#supported-net-app-frameworks-and-scenarios). From b00c7cec7d5c1897eab444476c877c5c4e1c290d Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Tue, 30 Sep 2025 10:49:36 -0700 Subject: [PATCH 06/12] Clarify .NET version applicability and update command options in dotnet publish documentation --- docs/core/tools/dotnet-publish.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index c15c7205b6b47..f2f6a503d4194 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -5,7 +5,7 @@ ms.date: 09/24/2025 --- # dotnet publish -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -21,9 +21,9 @@ dotnet publish [||] [-a|--arch ] [--manifest ] [--no-build] [--no-dependencies] [--no-restore] [--nologo] [-o|--output ] [--os ] [-r|--runtime ] - [--sc|--self-contained [true|false]] [--no-self-contained] + [--sc|--self-contained] [--no-self-contained] [-s|--source ] [--tl:[auto|on|off]] - [--use-current-runtime, --ucr [true|false]] + [--ucr|--use-current-runtime] [-v|--verbosity ] [--version-suffix ] dotnet publish -h|--help @@ -134,9 +134,7 @@ For more information, see the following resources: Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the *project.assets.json* file. -[!INCLUDE [help](../../../includes/cli-help.md)] - -[!INCLUDE [interactive](../../../includes/cli-interactive-3-0.md)] +[!INCLUDE [interactive](../../../includes/cli-interactive.md)] - **`--manifest `** @@ -182,11 +180,9 @@ For more information, see the following resources: [!INCLUDE [os](../../../includes/cli-os.md)] -- **`--sc|--self-contained [true|false]`** - - Publishes the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. Default is `true` if a runtime identifier is specified and the project is an executable project (not a library project). For more information, see [Self-contained deployment](../deploying/index.md#self-contained-deployment). +- **`--sc|--self-contained`** - If this option is used without specifying `true` or `false`, the default is `true`. In that case, don't put the solution or project argument immediately after `--self-contained`, because `true` or `false` is expected in that position. + Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. Available since .NET 6 SDK. - **`--no-self-contained`** @@ -202,9 +198,9 @@ For more information, see the following resources: [!INCLUDE [tl](../../../includes/cli-tl.md)] -- **`--use-current-runtime, --ucr [true|false]`** +- **`--ucr|--use-current-runtime`** - Sets the `RuntimeIdentifier` to a platform portable `RuntimeIdentifier` based on the one of your machine. This happens implicitly with properties that require a `RuntimeIdentifier`, such as `SelfContained`, `PublishAot`, `PublishSelfContained`, `PublishSingleFile`, and `PublishReadyToRun`. If the property is set to false, that implicit resolution will no longer occur. + Use current runtime as the target runtime. The default is `false`. [!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)] @@ -212,6 +208,8 @@ For more information, see the following resources: Defines the version suffix to replace the asterisk (`*`) in the version field of the project file. +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Examples - Create a [framework-dependent cross-platform binary](../deploying/index.md#cross-platform-dll-deployment) for the project in the current directory: From 0bbd25d96c8c40cfc166a096e323eddd7a153f40 Mon Sep 17 00:00:00 2001 From: "Meaghan Osagie (Lewis)" Date: Wed, 1 Oct 2025 09:36:27 -0700 Subject: [PATCH 07/12] Update docs/core/tools/dotnet-dev-certs.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/tools/dotnet-dev-certs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-dev-certs.md b/docs/core/tools/dotnet-dev-certs.md index 1b5b6f4707fed..13c71aa0913d7 100644 --- a/docs/core/tools/dotnet-dev-certs.md +++ b/docs/core/tools/dotnet-dev-certs.md @@ -64,7 +64,7 @@ The `dotnet dev-certs` command manages a self-signed certificate to enable HTTPS - **`--check-trust-machine-readable`** - Same as running `--check --trust`, but outputs the results in json. + Same as running `--check --trust`, but outputs the results in JSON. - **`--clean`** From ba47c88c939c5e3994f95d216f42bb5c2c9b99d3 Mon Sep 17 00:00:00 2001 From: "Meaghan Osagie (Lewis)" Date: Wed, 1 Oct 2025 09:36:36 -0700 Subject: [PATCH 08/12] Update docs/core/tools/dotnet-restore.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/tools/dotnet-restore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index 57a40c64121b2..e05d6dcc41667 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -133,7 +133,7 @@ There are three specific settings that `dotnet restore` ignores: - **`--no-http-cache`** - Disable Http Caching for packages. + Disable HTTP caching for packages. - **`--os`** From 9da6371f59f1fece65eeac48675cf9a3b8eb66bb Mon Sep 17 00:00:00 2001 From: "Meaghan Osagie (Lewis)" Date: Wed, 1 Oct 2025 09:37:09 -0700 Subject: [PATCH 09/12] Update docs/core/tools/dotnet-run.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/tools/dotnet-run.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-run.md b/docs/core/tools/dotnet-run.md index 6d1b6e137bc2e..733e661750f57 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -145,7 +145,7 @@ To run the application, the `dotnet run` command resolves the dependencies of th Specifies the path of the project file to run (folder name or full path). If not specified, it defaults to the current directory. - The [`-p` abbreviation for `--project` is deprecated](../compatibility/sdk/6.0/deprecate-p-option-dotnet-run.md) starting in .NET 6 SDK SDK. For a limited time starting in .NET 6 SDK RC1 SDK, `-p` can still be used for `--project` despite the deprecation warning. If the argument provided for the option doesn't contain `=`, the command accepts `-p` as short for `--project`. Otherwise, the command assumes that `-p` is short for `--property`. This flexible use of `-p` for `--project` will be phased out in .NET 7. + The [`-p` abbreviation for `--project` is deprecated](../compatibility/sdk/6.0/deprecate-p-option-dotnet-run.md) starting in .NET 6 SDK. For a limited time, `-p` can still be used for `--project` despite the deprecation warning. If the argument provided for the option doesn't contain `=`, the command accepts `-p` as short for `--project`. Otherwise, the command assumes that `-p` is short for `--property`. This flexible use of `-p` for `--project` will be phased out in .NET 7. - **`--property:=`** From 6746c407b4d64d5c6c484d44bcefc8686140b7eb Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Wed, 1 Oct 2025 10:11:02 -0700 Subject: [PATCH 10/12] Update dotnet format to clarify severity option usage --- docs/core/tools/dotnet-format.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index 7ef49a1ea7675..525db7ccc0671 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -18,7 +18,7 @@ dotnet format [] [--binarylog ] [--diagnostics ] [--exclude ] [--exclude-diagnostics ] [--include ] [--include-generated] - [--no-restore] [--report ] [--severity ] + [--no-restore] [--report ] [--severity ] [-v|--verbosity ] [--verify-no-changes] [--version] dotnet format -h|--help @@ -70,7 +70,7 @@ None of the options below are required for the `dotnet format` command to succee Produces a JSON report in the directory specified by ``. -- **`--severity`** +- **`--severity `** The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. @@ -118,7 +118,7 @@ The `dotnet format style` subcommand only runs formatting rules associated with A space-separated list of diagnostic IDs to use as a filter when fixing code style issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in code style analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md). -- **`--severity`** +- **`--severity `** The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn` @@ -136,7 +136,7 @@ The `dotnet format analyzers` subcommand only runs formatting rules associated w A space-separated list of diagnostic IDs to use as a filter when fixing non code style issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for quality rules](../../fundamentals/code-analysis/quality-rules/index.md). For third-party analyzers refer to their documentation. -- **`--severity`** +- **`--severity `** The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. From b5fcb7843596e03fd7641494e02735569348f644 Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Wed, 1 Oct 2025 11:37:23 -0700 Subject: [PATCH 11/12] Update description for self-contained and -no-self-contained options --- docs/core/tools/dotnet-build.md | 4 ++-- docs/core/tools/dotnet-publish.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index 3d734cb69eddc..076ee22f4b16c 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -113,7 +113,7 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev - **`--no-self-contained`** - Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application. Available since .NET 6 SDK. + Equivalent to `--self-contained false`. - **`-o|--output `** @@ -140,7 +140,7 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev - **`--sc|--self-contained`** - Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. Available since .NET 6 SDK. + Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. The default is `true`. - **`--source `** diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index f2f6a503d4194..5dcb974ff97fb 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -182,7 +182,7 @@ For more information, see the following resources: - **`--sc|--self-contained`** - Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. Available since .NET 6 SDK. + Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. The default is `true`. - **`--no-self-contained`** From 50a5e987caa8b245c528ee57410ec3dff53f0c82 Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Wed, 1 Oct 2025 16:54:49 -0700 Subject: [PATCH 12/12] Refactor command options to use include files for self-contained and runtime settings --- docs/core/tools/dotnet-build.md | 16 ++++------------ docs/core/tools/dotnet-format.md | 4 +--- docs/core/tools/dotnet-publish.md | 12 +++--------- docs/core/tools/dotnet-restore.md | 4 +--- docs/core/tools/dotnet-watch.md | 8 ++------ includes/cli-no-self-contained.md | 8 ++++++++ includes/cli-self-contained.md | 8 ++++++++ includes/cli-use-current-runtime.md | 8 ++++++++ 8 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 includes/cli-no-self-contained.md create mode 100644 includes/cli-self-contained.md create mode 100644 includes/cli-use-current-runtime.md diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index 076ee22f4b16c..2afb2721845f3 100644 --- a/docs/core/tools/dotnet-build.md +++ b/docs/core/tools/dotnet-build.md @@ -111,9 +111,7 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev Doesn't display the startup banner or the copyright message. -- **`--no-self-contained`** - - Equivalent to `--self-contained false`. +[!INCLUDE [no-self-contained](../../../includes/cli-no-self-contained.md)] - **`-o|--output `** @@ -138,9 +136,7 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev 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. -- **`--sc|--self-contained`** - - Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. The default is `true`. +[!INCLUDE [self-contained](../../../includes/cli-self-contained.md)] - **`--source `** @@ -148,13 +144,9 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev [!INCLUDE [tl](../../../includes/cli-tl.md)] -- **`--ucr|--use-current-runtime`** - - Use current runtime as the target runtime. The default is `false`. - -- **`-v|--verbosity `** +[!INCLUDE [use-current-runtime](../../../includes/cli-use-current-runtime.md)] - Sets the verbosity level of the command. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. The default is `minimal`. By default, MSBuild displays warnings and errors at all verbosity levels. To exclude warnings, use `/property:WarningLevel=0`. For more information, see and [WarningLevel](../../csharp/language-reference/compiler-options/errors-warnings.md#warninglevel). +[!INCLUDE [verbosity](../../../includes/cli-verbosity.md)] - **`--version-suffix `** diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index 525db7ccc0671..15229a303263c 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -82,9 +82,7 @@ None of the options below are required for the `dotnet format` command to succee Displays version information. -- **`-v|--verbosity `** - - Sets the verbosity level. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. Default value is `m[inimal]`. +[!INCLUDE [verbosity](../../../includes/cli-verbosity.md)] [!INCLUDE [help](../../../includes/cli-help.md)] diff --git a/docs/core/tools/dotnet-publish.md b/docs/core/tools/dotnet-publish.md index 5dcb974ff97fb..db8c698266bf3 100644 --- a/docs/core/tools/dotnet-publish.md +++ b/docs/core/tools/dotnet-publish.md @@ -180,13 +180,9 @@ For more information, see the following resources: [!INCLUDE [os](../../../includes/cli-os.md)] -- **`--sc|--self-contained`** +[!INCLUDE [self-contained](../../../includes/cli-self-contained.md)] - Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. The default is `true`. - -- **`--no-self-contained`** - - Equivalent to `--self-contained false`. +[!INCLUDE [no-self-contained](../../../includes/cli-no-self-contained.md)] - **`--source `** @@ -198,9 +194,7 @@ For more information, see the following resources: [!INCLUDE [tl](../../../includes/cli-tl.md)] -- **`--ucr|--use-current-runtime`** - - Use current runtime as the target runtime. The default is `false`. +[!INCLUDE [use-current-runtime](../../../includes/cli-use-current-runtime.md)] [!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)] diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index e05d6dcc41667..cdb46e99542f9 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -153,9 +153,7 @@ There are three specific settings that `dotnet restore` ignores: Specifies the URI of the NuGet package source to use during the restore operation. This setting overrides all of the sources specified in the *nuget.config* files. Multiple sources can be provided by specifying this option multiple times. -- **`-ucr|--use-current-runtime`** - - Use current runtime as the target runtime. The default is `false`. +[!INCLUDE [use-current-runtime](../../../includes/cli-use-current-runtime.md)] - **`--use-lock-file`** diff --git a/docs/core/tools/dotnet-watch.md b/docs/core/tools/dotnet-watch.md index 0a2883c43d5f1..7837de32ec8ca 100644 --- a/docs/core/tools/dotnet-watch.md +++ b/docs/core/tools/dotnet-watch.md @@ -71,9 +71,7 @@ As an alternative to disabling response compression, manually add the browser re Lists all discovered files without starting the watcher. -- **`--no-self-contained`** - - Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application. Available since .NET 6 SDK. +[!INCLUDE [no-self-contained](../../../includes/cli-no-self-contained.md)] - **`--no-hot-reload`** @@ -87,9 +85,7 @@ As an alternative to disabling response compression, manually add the browser re Specifies the path of the project file to run (folder only or including the project file name). If not specified, it defaults to the current directory. -- **`--sc|--self-contained`** - - Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is `false`. However, when targeting .NET 7 or lower, the default is `true` if a runtime identifier is specified. Available since .NET 6 SDK. +[!INCLUDE [self-contained](../../../includes/cli-self-contained.md)] - **`-q|--quiet`** diff --git a/includes/cli-no-self-contained.md b/includes/cli-no-self-contained.md new file mode 100644 index 0000000000000..2444880f5d7b3 --- /dev/null +++ b/includes/cli-no-self-contained.md @@ -0,0 +1,8 @@ +--- +ms.date: 10/01/2025 +ms.topic: include +--- + +- **`--no-self-contained`** + + Equivalent to `--self-contained false`. diff --git a/includes/cli-self-contained.md b/includes/cli-self-contained.md new file mode 100644 index 0000000000000..7cf7803ab42d6 --- /dev/null +++ b/includes/cli-self-contained.md @@ -0,0 +1,8 @@ +--- +ms.date: 10/01/2025 +ms.topic: include +--- + +- **`--sc|--self-contained`** + + Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. The default is `true`. diff --git a/includes/cli-use-current-runtime.md b/includes/cli-use-current-runtime.md new file mode 100644 index 0000000000000..3f101fa42abe8 --- /dev/null +++ b/includes/cli-use-current-runtime.md @@ -0,0 +1,8 @@ +--- +ms.date: 10/01/2025 +ms.topic: include +--- + +- **`--ucr|--use-current-runtime`** + + Use the current runtime as the target runtime.