You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refresh dotnet command reference to use latest commands and .NET 6 and later versions
* Update dotnet format documentation for clarity and accuracy
* update options list format
* reduce spacing for command options list
* Specify .NET 6 SDK as minimum version and update options
* Clarify .NET version applicability and update command options in dotnet publish documentation
* Update docs/core/tools/dotnet-dev-certs.md
Co-authored-by: Genevieve Warren <[email protected]>
* Update docs/core/tools/dotnet-restore.md
Co-authored-by: Genevieve Warren <[email protected]>
* Update docs/core/tools/dotnet-run.md
Co-authored-by: Genevieve Warren <[email protected]>
* Update dotnet format to clarify severity option usage
* Update description for self-contained and -no-self-contained options
* Refactor command options to use include files for self-contained and runtime settings
---------
Co-authored-by: Genevieve Warren <[email protected]>
@@ -95,8 +93,6 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev
95
93
96
94
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.
@@ -115,9 +111,7 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev
115
111
116
112
Doesn't display the startup banner or the copyright message.
117
113
118
-
-**`--no-self-contained`**
119
-
120
-
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.
@@ -142,28 +136,24 @@ Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; howev
142
136
143
137
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.
144
138
145
-
-**`--self-contained [true|false]`**
146
-
147
-
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.
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 <xref:Microsoft.Build.Framework.LoggerVerbosity> and [WarningLevel](../../csharp/language-reference/compiler-options/errors-warnings.md#warninglevel).
158
-
159
-
-**`--use-current-runtime, --ucr [true|false]`**
160
-
161
-
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 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.
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-dev-certs.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
title: dotnet dev-certs command
3
3
description: The dotnet dev-certs command generates a self-signed certificate to enable HTTPS use in development.
4
-
ms.date: 07/14/2022
4
+
ms.date: 09/29/2025
5
5
---
6
6
# dotnet dev-certs
7
7
8
-
**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions
8
+
**This article applies to:** ✔️ .NET 6 SDK and later versions
9
9
10
10
## Name
11
11
@@ -15,7 +15,8 @@ ms.date: 07/14/2022
15
15
16
16
```dotnetcli
17
17
dotnet dev-certs https
18
-
[-c|--check] [--clean] [-ep|--export-path <PATH>]
18
+
[-c|--check] [--check-trust-machine-readable]
19
+
[--clean] [-ep|--export-path <PATH>]
19
20
[--format] [-i|--import] [-np|--no-password]
20
21
[-p|--password] [-q|--quiet] [-t|--trust]
21
22
[-v|--verbose] [--version]
@@ -61,6 +62,10 @@ The `dotnet dev-certs` command manages a self-signed certificate to enable HTTPS
61
62
62
63
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.
63
64
65
+
-**`--check-trust-machine-readable`**
66
+
67
+
Same as running `--check --trust`, but outputs the results in JSON.
68
+
64
69
-**`--clean`**
65
70
66
71
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
188
193
189
194
## See also
190
195
191
-
*[Generate self-signed certificates with the .NET CLI](../additional-tools/self-signed-certificates-guide.md)
192
-
*[Enforce HTTPS in ASP.NET Core](/aspnet/core/security/enforcing-ssl)
193
-
*[Troubleshoot certificate problems such as certificate not trusted](/aspnet/core/security/enforcing-ssl#troubleshoot-certificate-problems-such-as-certificate-not-trusted)
194
-
*[Hosting ASP.NET Core images with Docker over HTTPS](/aspnet/core/security/docker-https)
195
-
*[Hosting ASP.NET Core images with Docker Compose over HTTPS](/aspnet/core/security/docker-compose-https)
196
+
-[Generate self-signed certificates with the .NET CLI](../additional-tools/self-signed-certificates-guide.md)
197
+
-[Enforce HTTPS in ASP.NET Core](/aspnet/core/security/enforcing-ssl)
198
+
-[Troubleshoot certificate problems such as certificate not trusted](/aspnet/core/security/enforcing-ssl#troubleshoot-certificate-problems-such-as-certificate-not-trusted)
199
+
-[Hosting ASP.NET Core images with Docker over HTTPS](/aspnet/core/security/docker-https)
200
+
-[Hosting ASP.NET Core images with Docker Compose over HTTPS](/aspnet/core/security/docker-compose-https)
@@ -33,49 +38,53 @@ The MSBuild project or solution to run code formatting on. If a project or solut
33
38
34
39
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.
35
40
36
-
***`--diagnostics <DIAGNOSTICS>`**
41
+
-**`--binarylog <BINARY-LOG-PATH>`**
37
42
38
-
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).
43
+
Logs all project or solution load information to a binary log file.
39
44
40
-
***`--severity`**
45
+
-**`--diagnostics <DIAGNOSTICS>`**
41
46
42
-
The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`.
47
+
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).
43
48
44
-
***`--no-restore`**
49
+
-**`--exclude <EXCLUDE>`**
45
50
46
-
Doesn't execute an implicit restore before formatting. Default is to do implicit restore.
51
+
A space-separated list of relative file or folder paths to exclude from formatting. The default is none.
Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted.
55
+
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).
51
56
52
-
***`--include <INCLUDE>`**
57
+
-**`--include <INCLUDE>`**
53
58
54
59
A space-separated list of relative file or folder paths to include in formatting. The default is all files in the solution or project.
55
60
56
-
***`--exclude <EXCLUDE>`**
61
+
-**`--include-generated`**
57
62
58
-
A space-separated list of relative file or folder paths to exclude from formatting. The default is none.
63
+
Formats files generated by the SDK.
59
64
60
-
***`--include-generated`**
65
+
-**`--no-restore`**
61
66
62
-
Formats files generated by the SDK.
67
+
Doesn't execute an implicit restore before formatting. Default is to do implicit restore.
63
68
64
-
***`-v|--verbosity <LEVEL>`**
69
+
-**`--report <REPORT-PATH>`**
65
70
66
-
Sets the verbosity level. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. Default value is `m[inimal]`.
71
+
Produces a JSON report in the directory specified by `<REPORT_PATH>`.
67
72
68
-
***`--binarylog <BINARY-LOG-PATH>`**
73
+
-**`--severity <LEVEL>`**
69
74
70
-
Logs all project or solution load information to a binary log file.
75
+
The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`.
71
76
72
-
***`--report <REPORT-PATH>`**
77
+
-**`--verify-no-changes`**
73
78
74
-
Produces a JSON report in the directory specified by `<REPORT_PATH>`.
79
+
Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted.
@@ -89,7 +98,7 @@ The `dotnet format whitespace` subcommand only runs formatting rules associated
89
98
90
99
#### Options
91
100
92
-
***`--folder`**
101
+
-**`--folder`**
93
102
94
103
Treat the `<PROJECT | SOLUTION>` argument as a path to a simple folder of code files.
95
104
@@ -103,11 +112,11 @@ The `dotnet format style` subcommand only runs formatting rules associated with
103
112
104
113
#### Options
105
114
106
-
***`--diagnostics <DIAGNOSTICS>`**
115
+
-**`--diagnostics <DIAGNOSTICS>`**
107
116
108
117
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).
109
118
110
-
***`--severity`**
119
+
-**`--severity <LEVEL>`**
111
120
112
121
The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`
113
122
@@ -121,59 +130,59 @@ The `dotnet format analyzers` subcommand only runs formatting rules associated w
121
130
122
131
##### Options
123
132
124
-
***`--diagnostics <DIAGNOSTICS>`**
133
+
-**`--diagnostics <DIAGNOSTICS>`**
125
134
126
135
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.
127
136
128
-
***`--severity`**
137
+
-**`--severity <LEVEL>`**
129
138
130
139
The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`.
131
140
132
141
## Examples
133
142
134
-
* Format all code in the solution:
143
+
- Format all code in the solution:
135
144
136
145
```dotnetcli
137
146
dotnet format ./solution.sln
138
147
```
139
148
140
-
* Clean up all code in the application project:
149
+
- Clean up all code in the application project:
141
150
142
151
```dotnetcli
143
152
dotnet format ./src/application.csproj
144
153
```
145
154
146
-
* Verify that all code is correctly formatted:
155
+
- Verify that all code is correctly formatted:
147
156
148
157
```dotnetcli
149
158
dotnet format --verify-no-changes
150
159
```
151
160
152
-
* Clean up all code in the *src* and *tests* directory but not in *src/submodule-a*:
161
+
- Clean up all code in the *src* and *tests* directory but not in *src/submodule-a*:
153
162
154
163
```dotnetcli
155
164
dotnet format --include ./src/ ./tests/ --exclude ./src/submodule-a/
156
165
```
157
166
158
-
* Fix a specific **code style** issue:
167
+
- Fix a specific **code style** issue:
159
168
160
169
```dotnetcli
161
170
dotnet format style --diagnostics IDE0005 --severity info
162
171
```
163
172
164
-
* Fix all **code style** issues that have severity `info`, `warning` or `error`:
173
+
- Fix all **code style** issues that have severity `info`, `warning` or `error`:
165
174
166
175
```dotnetcli
167
176
dotnet format style --severity info
168
177
```
169
178
170
-
* Fix a specific (non code style) analyzer issue:
179
+
- Fix a specific (non code style) analyzer issue:
171
180
172
181
```dotnetcli
173
182
dotnet format analyzers --diagnostics CA1831 --severity warn
174
183
```
175
184
176
-
* Fix all non code style issues that have severity `info`, `warning` or `error`:
185
+
- Fix all non code style issues that have severity `info`, `warning` or `error`:
0 commit comments