diff --git a/docs/core/tools/dotnet-build.md b/docs/core/tools/dotnet-build.md index d4ac620eb2725..2afb2721845f3 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`** @@ -115,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`** - - 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)] - **`-o|--output `** @@ -142,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. -- **`--self-contained [true|false]`** - - 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. +[!INCLUDE [self-contained](../../../includes/cli-self-contained.md)] - **`--source `** @@ -152,18 +144,16 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev [!INCLUDE [tl](../../../includes/cli-tl.md)] -- **`-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). - -- **`--use-current-runtime, --ucr [true|false]`** - - 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. +[!INCLUDE [verbosity](../../../includes/cli-verbosity.md)] - **`--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 a053f0964952b..13c71aa0913d7 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 SDK and later versions ## Name @@ -15,7 +15,8 @@ ms.date: 07/14/2022 ```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] @@ -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. @@ -188,8 +193,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-format.md b/docs/core/tools/dotnet-format.md index 6dbffdda791ac..15229a303263c 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 SDK and later versions ## Name @@ -14,7 +14,12 @@ ms.date: 07/12/2021 ## Synopsis ```dotnetcli -dotnet format [] [command] [options] +dotnet format [] + [--binarylog ] [--diagnostics ] + [--exclude ] [--exclude-diagnostics ] + [--include ] [--include-generated] + [--no-restore] [--report ] [--severity ] + [-v|--verbosity ] [--verify-no-changes] [--version] dotnet format -h|--help ``` @@ -33,49 +38,53 @@ 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 `** +- **`--binarylog `** - 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). + 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 `** +- **`--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 `** +- **`--include-generated`** - A space-separated list of relative file or folder paths to exclude from formatting. The default is none. + Formats files generated by the SDK. -* **`--include-generated`** +- **`--no-restore`** - Formats files generated by the SDK. + Doesn't execute an implicit restore before formatting. Default is to do implicit restore. -* **`-v|--verbosity `** +- **`--report `** - Sets the verbosity level. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. Default value is `m[inimal]`. + Produces a JSON report in the directory specified by ``. -* **`--binarylog `** +- **`--severity `** - Logs all project or solution load information to a binary log file. + The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`. -* **`--report `** +- **`--verify-no-changes`** - Produces a JSON report in the directory specified by ``. + 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. -* **`-h|--help`** +[!INCLUDE [verbosity](../../../includes/cli-verbosity.md)] - Shows help and usage information +[!INCLUDE [help](../../../includes/cli-help.md)] ## Subcommands @@ -89,7 +98,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 +112,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 +130,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 diff --git a/docs/core/tools/dotnet-msbuild.md b/docs/core/tools/dotnet-msbuild.md index 6d6d51c926c81..20ceb31520d12 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 SDK and later versions ## Name diff --git a/docs/core/tools/dotnet-pack.md b/docs/core/tools/dotnet-pack.md index e21a1e37127d4..b1db4d6dbc5f4 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 SDK and later versions ## Name @@ -14,13 +14,13 @@ ms.date: 04/04/2024 ## Synopsis ```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 ] - [--version-suffix ] +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 ] dotnet pack -h|--help ``` @@ -64,12 +64,12 @@ 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. -[!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. @@ -78,7 +78,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`** @@ -132,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 11fbd48aa8f45..3c3d77f2421bb 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 SDK 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,8 @@ ms.date: 04/02/2025 ## Synopsis ```dotnetcli -dotnet package remove [--project ] +dotnet package remove + [--file ] [--interactive] [--project ] dotnet package remove -h|--help ``` @@ -28,16 +29,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 +- **`--file `** + + The file-based app to operate on. + +[!INCLUDE [interactive](../../../includes/cli-interactive.md)] + +- **`-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 [help](../../../includes/cli-help.md)] ## Examples @@ -47,3 +54,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-publish.md b/docs/core/tools/dotnet-publish.md index c15c7205b6b47..db8c698266bf3 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,15 +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). - - 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. +[!INCLUDE [self-contained](../../../includes/cli-self-contained.md)] -- **`--no-self-contained`** - - Equivalent to `--self-contained false`. +[!INCLUDE [no-self-contained](../../../includes/cli-no-self-contained.md)] - **`--source `** @@ -202,9 +194,7 @@ For more information, see the following resources: [!INCLUDE [tl](../../../includes/cli-tl.md)] -- **`--use-current-runtime, --ucr [true|false]`** - - 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. +[!INCLUDE [use-current-runtime](../../../includes/cli-use-current-runtime.md)] [!INCLUDE [verbosity](../../../includes/cli-verbosity-minimal.md)] @@ -212,6 +202,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: diff --git a/docs/core/tools/dotnet-restore.md b/docs/core/tools/dotnet-restore.md index 2ca8374b29b70..cdb46e99542f9 100644 --- a/docs/core/tools/dotnet-restore.md +++ b/docs/core/tools/dotnet-restore.md @@ -1,11 +1,11 @@ --- 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 -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -14,14 +14,15 @@ ms.date: 09/24/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-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 [||] + [-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]] [--ucr|--use-current-runtime] [--use-lock-file] + [-v|--verbosity ] dotnet restore -h|--help ``` @@ -108,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. @@ -132,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. @@ -144,30 +153,18 @@ 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]`** - - 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. +[!INCLUDE [use-current-runtime](../../../includes/cli-use-current-runtime.md)] - **`--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 52d837939bb34..733e661750f57 100644 --- a/docs/core/tools/dotnet-run.md +++ b/docs/core/tools/dotnet-run.md @@ -1,11 +1,11 @@ --- 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 -**This article applies to:** ✔️ .NET 6 and later versions +**This article applies to:** ✔️ .NET 6 SDK and later versions ## Name @@ -14,14 +14,14 @@ 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 ] - [[--] [application arguments]] +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 +69,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. @@ -105,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 `** @@ -117,6 +119,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,13 +135,17 @@ 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 `** 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. 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:=`** @@ -158,10 +168,16 @@ 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)] +[!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 3316eb07d527a..c792997fe5d7f 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 SDK and later versions ## Name @@ -14,11 +14,13 @@ ms.date: 02/14/2020 ## Synopsis ```dotnetcli -dotnet store -m|--manifest - -f|--framework -r|--runtime - [--framework-version ] [--output ] - [--skip-optimization] [--skip-symbols] [-v|--verbosity ] - [--working-dir ] +dotnet store [-m|--manifest ] + [-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 ``` @@ -33,6 +35,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`. @@ -47,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. @@ -61,12 +63,18 @@ dotnet store -h|--help Skips symbol generation. Currently, you can only generate symbols on Windows and Linux. +- **`--ucr|--use-current-runtime`** + + Use current runtime as the target runtime. The default is `false`. + [!INCLUDE [verbosity](../../../includes/cli-verbosity.md)] - **`-w|--working-dir `** 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 062608d4ccc2f..39aa0b95a63eb 100644 --- a/docs/core/tools/dotnet-test.md +++ b/docs/core/tools/dotnet-test.md @@ -1,10 +1,12 @@ --- 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 +**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 Core 3.1 SDK and later versions - #### Synopsis ```dotnetcli @@ -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..7837de32ec8ca 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 SDK and later versions ## Name @@ -15,11 +15,10 @@ ms.date: 06/03/2024 ```dotnetcli dotnet watch [] - [--list] - [--no-hot-reload] [--non-interactive] - [--project ] - [-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 @@ -64,10 +63,16 @@ 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. +[!INCLUDE [no-self-contained](../../../includes/cli-no-self-contained.md)] + - **`--no-hot-reload`** Suppress [hot reload](#hot-reload) for [supported apps](/visualstudio/debugger/hot-reload#supported-net-app-frameworks-and-scenarios). @@ -80,6 +85,8 @@ 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. +[!INCLUDE [self-contained](../../../includes/cli-self-contained.md)] + - **`-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. @@ -96,6 +103,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: @@ -211,7 +220,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). 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.