1dotnet command(1) .NET Core dotnet command(1)
2
3
4
7 dotnet - A tool for managing .NET source code and binaries.
8
10 .NET Core 2.1
11 dotnet [command] [arguments] [--additional-deps] [--additionalprobingpath] [--depsfile]
12 [-d|--diagnostics] [--fx-version] [-h|--help] [--info] [--list-runtimes] [--list-sdks] [--roll-forward-on-no-candidate-fx] [--runtimeconfig] [-v|--verbosity] [--version]
13
14 .NET Core 2.0
15 dotnet [command] [arguments] [--additional-deps] [--additionalprobingpath] [--depsfile]
16 [-d|--diagnostics] [--fx-version] [-h|--help] [--info] [--roll-forward-on-no-candidate-fx]
17 [--runtimeconfig] [-v|--verbosity] [--version]
18
19 .NET Core 1.x
20 dotnet [command] [arguments] [--additionalprobingpath] [--depsfile] [-d|--diagnostics]
21 [--fx-version] [-h|--help] [--info] [--runtimeconfig] [-v|--verbosity] [--version]
22
23 * * * * *
24
26 dotnet is a tool for managing .NET source code and binaries. It expos‐
27 es commands that perform specific tasks, such as dotnet build and dot‐
28 net run. Each command defines its own arguments. Type --help after
29 each command to access brief help documentation.
30
31 dotnet can be used to run applications, by specifying an application
32 DLL, such as dotnet myapp.dll. See .NET Core application deployment
33 for to learn about deployment options.
34
36 .NET Core 2.1
37 --additional-deps <PATH>
38
39 Path to an additional .deps.json file.
40
41 --additionalprobingpath <PATH>
42
43 Path containing probing policy and assemblies to probe.
44
45 --depsfile
46
47 Path to a deps.json file.
48
49 A deps.json file contains a list of dependencies, compilation dependen‐
50 cies and version information used to address assembly conflicts. For
51 more information about this file, see Runtime Configuration Files on
52 GitHub.
53
54 -d|--diagnostics
55
56 Enables diagnostic output.
57
58 --fx-version <VERSION>
59
60 Version of the .NET Core runtime to use to run the application.
61
62 -h|--help
63
64 Prints out documentation for a given command, such as dotnet build
65 --help. dotnet --help prints a list of available commands.
66
67 --info
68
69 Prints out detailed information about a .NET Core installation and the
70 machine environment, such as the current operating system, and commit
71 SHA of the .NET Core version.
72
73 --list-runtimes
74
75 Displays the installed .NET Core runtimes.
76
77 --list-sdks
78
79 Displays the installed .NET Core SDKs.
80
81 --roll-forward-on-no-candidate-fx <N>
82
83 Defines behavior when the required shared framework is not available.
84 N can be:
85
86 • 0 - Disable even minor version roll forward.
87
88 • 1 - Roll forward on minor version, but not on major version. This is
89 the default behavior.
90
91 • 2 - Roll forward on minor and major versions.
92
93 For more information, see Roll forward.
94
95 --runtimeconfig
96
97 Path to a runtimeconfig.json file.
98
99 A runtimeconfig.json file is a configuration file containing runtime
100 configuration settings. For more information, see Runtime Configura‐
101 tion Files on GitHub.
102
103 -v|--verbosity <LEVEL>
104
105 Sets the verbosity level of the command. Allowed values are q[uiet],
106 m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in
107 every command; see specific command page to determine if this option is
108 available.
109
110 --version
111
112 Prints out the version of the .NET Core SDK in use.
113
114 .NET Core 2.0
115 --additional-deps <PATH>
116
117 Path to an additional .deps.json file.
118
119 --additionalprobingpath <PATH>
120
121 Path containing probing policy and assemblies to probe.
122
123 --depsfile
124
125 Path to a deps.json file.
126
127 A deps.json file contains a list of dependencies, compilation dependen‐
128 cies and version information used to address assembly conflicts. For
129 more details on this file, see Runtime Configuration Files on GitHub.
130
131 -d|--diagnostics
132
133 Enables diagnostic output.
134
135 --fx-version <VERSION>
136
137 Version of the .NET Core runtime to use to run the application.
138
139 -h|--help
140
141 Prints out documentation for a given command, such as dotnet build
142 --help. dotnet --help prints a list of available commands.
143
144 --info
145
146 Prints out detailed information about a .NET Core installation and the
147 machine environment, such as the current operating system, and commit
148 SHA of the .NET Core version.
149
150 --roll-forward-on-no-candidate-fx
151
152 Disables minor version roll forward, if set to 0. For more informa‐
153 tion, see Roll forward.
154
155 --runtimeconfig
156
157 Path to a runtimeconfig.json file.
158
159 A runtimeconfig.json file is a configuration file containing runtime
160 configuration settings. For more details, see Runtime Configuration
161 Files on GitHub.
162
163 -v|--verbosity <LEVEL>
164
165 Sets the verbosity level of the command. Allowed values are q[uiet],
166 m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in
167 every command; see specific command page to determine if this option is
168 available.
169
170 --version
171
172 Prints out the version of the .NET Core SDK in use.
173
174 .NET Core 1.x
175 --additionalprobingpath <PATH>
176
177 Path containing probing policy and assemblies to probe.
178
179 --depsfile
180
181 Path to a deps.json file.
182
183 A deps.json file contains a list of dependencies, compilation dependen‐
184 cies and version information used to address assembly conflicts. For
185 more details on this file, see Runtime Configuration Files on GitHub.
186
187 -d|--diagnostics
188
189 Enables diagnostic output.
190
191 --fx-version <VERSION>
192
193 Version of the .NET Core runtime to use to run the application.
194
195 -h|--help
196
197 Prints out documentation for a given command, such as dotnet build
198 --help. dotnet --help prints a list of available commands.
199
200 --info
201
202 Prints out detailed information about a .NET Core installation and the
203 machine environment, such as the current operating system, and commit
204 SHA of the .NET Core version.
205
206 --runtimeconfig
207
208 Path to a runtimeconfig.json file.
209
210 A runtimeconfig.json file is a configuration file containing runtime
211 configuration settings. For more details, see Runtime Configuration
212 Files on GitHub.
213
214 -v|--verbosity <LEVEL>
215
216 Sets the verbosity level of the command. Allowed values are q[uiet],
217 m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in
218 every command; see specific command page to determine if this option is
219 available.
220
221 --version
222
223 Prints out the version of the .NET Core SDK in use.
224
225 * * * * *
226
227 dotnet commands
228 General
229 .NET Core 2.1
230 Command Function
231 ─────────────────────────────────────────────────
232 dotnet build Builds a .NET Core appli‐
233 cation.
234 dotnet build-server Interacts with servers
235 started by a build.
236 dotnet clean Clean build outputs.
237 dotnet help Shows more detailed docu‐
238 mentation online for the
239 command.
240 dotnet migrate Migrates a valid Preview 2
241 project to a .NET Core SDK
242 1.0 project.
243 dotnet msbuild Provides access to the MS‐
244 Build command line.
245 dotnet new Initializes a C# or F#
246 project for a given tem‐
247 plate.
248 dotnet pack Creates a NuGet package of
249 your code.
250 dotnet publish Publishes a .NET frame‐
251 work-dependent or self-
252 contained application.
253 dotnet restore Restores the dependencies
254 for a given application.
255 dotnet run Runs the application from
256 source.
257 dotnet sln Options to add, remove,
258 and list projects in a so‐
259 lution file.
260 dotnet store Stores assemblies in the
261 runtime package store.
262 dotnet test Runs tests using a test
263 runner.
264
265 .NET Core 2.0
266 Command Function
267 ────────────────────────────────────────────
268 dotnet build Builds a .NET Core appli‐
269 cation.
270 dotnet clean Clean build outputs.
271 dotnet help Shows more detailed docu‐
272 mentation online for the
273 command.
274 dotnet migrate Migrates a valid Preview 2
275 project to a .NET Core SDK
276 1.0 project.
277 dotnet msbuild Provides access to the MS‐
278 Build command line.
279 dotnet new Initializes a C# or F#
280 project for a given tem‐
281 plate.
282 dotnet pack Creates a NuGet package of
283 your code.
284 dotnet publish Publishes a .NET frame‐
285 work-dependent or self-
286 contained application.
287 dotnet restore Restores the dependencies
288 for a given application.
289 dotnet run Runs the application from
290 source.
291 dotnet sln Options to add, remove,
292 and list projects in a so‐
293 lution file.
294 dotnet store Stores assemblies in the
295 runtime package store.
296 dotnet test Runs tests using a test
297 runner.
298
299 .NET Core 1.x
300 Command Function
301 ────────────────────────────────────────────
302 dotnet build Builds a .NET Core appli‐
303 cation.
304 dotnet clean Clean build outputs.
305 dotnet migrate Migrates a valid Preview 2
306 project to a .NET Core SDK
307 1.0 project.
308 dotnet msbuild Provides access to the MS‐
309 Build command line.
310 dotnet new Initializes a C# or F#
311 project for a given tem‐
312 plate.
313 dotnet pack Creates a NuGet package of
314 your code.
315 dotnet publish Publishes a .NET frame‐
316 work-dependent or self-
317 contained application.
318 dotnet restore Restores the dependencies
319 for a given application.
320 dotnet run Runs the application from
321 source.
322 dotnet sln Options to add, remove,
323 and list projects in a so‐
324 lution file.
325 dotnet test Runs tests using a test
326 runner.
327
328 * * * * *
329
330 Project references
331 Command Function
332 ─────────────────────────────────────────────────────
333 dotnet add reference Adds a project reference.
334 dotnet list reference Lists project references.
335 dotnet remove reference Removes a project refer‐
336 ence.
337
338 NuGet packages
339 Command Function
340 ─────────────────────────────────────────────────
341 dotnet add package Adds a NuGet package.
342 dotnet remove package Removes a NuGet package.
343
344 NuGet commands
345 Command Function
346 ─────────────────────────────────────────────────
347 dotnet nuget delete Deletes or unlists a pack‐
348 age from the server.
349 dotnet nuget locals Clears or lists local
350 NuGet resources such as
351 http-request cache, tempo‐
352 rary cache, or machine-
353 wide global packages fold‐
354 er.
355 dotnet nuget push Pushes a package to the
356 server and publishes it.
357
358 Global Tools commands
359 .NET Core Global Tools are available starting with .NET Core SDK
360 2.1.300:
361
362 Command Function
363 ───────────────────────────────────────────────────
364 dotnet tool install Installs a Global Tool on
365 your machine.
366 dotnet tool list Lists all Global Tools
367 currently installed in the
368 default directory on your
369 machine or in the speci‐
370 fied path.
371 dotnet tool uninstall Uninstalls a Global Tool
372 from your machine.
373 dotnet tool update Updates a Global Tool on
374 your machine.
375
376 Additional tools
377 Starting with .NET Core SDK 2.1.300, a number of tools that were avail‐
378 able only on a per project basis using DotnetCliToolReference are now
379 available as part of the .NET Core SDK. These tools are listed in the
380 following table:
381
382 Tool Function
383 ──────────────────────────────────────────
384 dev-certs Creates and manages devel‐
385 opment certificates.
386 ef Entity Framework Core com‐
387 mand-line tools.
388 sql-cache SQL Server cache command-
389 line tools.
390 user-secrets Manages development user
391 secrets.
392 watch Starts a file watcher that
393 runs a command when files
394 change.
395
396 For more information about each tool, type dotnet <tool-name> --help.
397
399 Creates a new .NET Core console application:
400
401 dotnet new console
402
403 Restore dependencies for a given application:
404
405 dotnet restore
406
407 Build a project and its dependencies in a given directory:
408
409 dotnet build
410
411 Run an application DLL, such as myapp.dll:
412
413 dotnet myapp.dll
414
416 .NET Core 2.1
417 DOTNET_PACKAGES
418
419 The global packages folder. If not set, it defaults to ~/.nuget/pack‐
420 ages on Unix or %userprofile%\.nuget\packages on Windows.
421
422 DOTNET_SERVICING
423
424 Specifies the location of the servicing index to use by the shared host
425 when loading the runtime.
426
427 DOTNET_CLI_TELEMETRY_OPTOUT
428
429 Specifies whether data about the .NET Core tools usage is collected and
430 sent to Microsoft. Set to true to opt-out of the telemetry feature
431 (values true, 1, or yes accepted). Otherwise, set to false to opt into
432 the telemetry features (values false, 0, or no accepted). If not set,
433 the default is false and the telemetry feature is active.
434
435 DOTNET_MULTILEVEL_LOOKUP
436
437 Specifies whether .NET Core runtime, shared framework, or SDK are re‐
438 solved from the global location. If not set, it defaults to true. Set
439 to false to not resolve from the global location and have isolated .NET
440 Core installations (values 0 or false are accepted). For more informa‐
441 tion about multi-level lookup, see Multi-level SharedFX Lookup.
442
443 DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX
444
445 Disables minor version roll forward, if set to 0. For more informa‐
446 tion, see Roll forward.
447
448 .NET Core 2.0
449 DOTNET_PACKAGES
450
451 The primary package cache. If not set, it defaults to
452 $HOME/.nuget/packages on Unix or %userprofile%\.nuget\packages on Win‐
453 dows.
454
455 DOTNET_SERVICING
456
457 Specifies the location of the servicing index to use by the shared host
458 when loading the runtime.
459
460 DOTNET_CLI_TELEMETRY_OPTOUT
461
462 Specifies whether data about the .NET Core tools usage is collected and
463 sent to Microsoft. Set to true to opt-out of the telemetry feature
464 (values true, 1, or yes accepted). Otherwise, set to false to opt into
465 the telemetry features (values false, 0, or no accepted). If not set,
466 the default is false and the telemetry feature is active.
467
468 DOTNET_MULTILEVEL_LOOKUP
469
470 Specifies whether .NET Core runtime, shared framework, or SDK are re‐
471 solved from the global location. If not set, it defaults to true. Set
472 to false to not resolve from the global location and have isolated .NET
473 Core installations (values 0 or false are accepted). For more informa‐
474 tion about multi-level lookup, see Multi-level SharedFX Lookup.
475
476 .NET Core 1.x
477 DOTNET_PACKAGES
478
479 The primary package cache. If not set, it defaults to
480 $HOME/.nuget/packages on Unix or %userprofile%\.nuget\packages on Win‐
481 dows.
482
483 DOTNET_SERVICING
484
485 Specifies the location of the servicing index to use by the shared host
486 when loading the runtime.
487
488 DOTNET_CLI_TELEMETRY_OPTOUT
489
490 Specifies whether data about the .NET Core tools usage is collected and
491 sent to Microsoft. Set to true to opt-out of the telemetry feature
492 (values true, 1, or yes accepted). Otherwise, set to false to opt into
493 the telemetry features (values false, 0, or no accepted). If not set,
494 the default is false and the telemetry feature is active.
495
496 * * * * *
497
498 See also
499 • Runtime Configuration Files
500
501
502
503 dotnet command(1)