1dotnet command(1)                  .NET Core                 dotnet command(1)
2
3
4

dotnet command

NAME

7       dotnet - A tool for managing .NET source code and binaries.
8

SYNOPSIS

10   .NET Core 2.1
11              dotnet [command] [arguments] [--additional-deps] [--additionalprobingpath] [-d|--diagnostics] [--fx-version]
12                  [-h|--help] [--info] [--list-runtimes] [--list-sdks] [--roll-forward-on-no-candidate-fx] [-v|--verbosity] [--version]
13
14   .NET Core 2.0
15              dotnet [command] [arguments] [--additional-deps] [--additionalprobingpath] [-d|--diagnostics]
16                  [--fx-version] [-h|--help] [--info] [--roll-forward-on-no-candidate-fx] [-v|--verbosity] [--version]
17
18   .NET Core 1.x
19              dotnet [command] [arguments] [--additionalprobingpath] [-d|--diagnostics] [--fx-version]
20                  [-h|--help] [--info] [-v|--verbosity] [--version]
21
22          *   *   *   *   *
23

DESCRIPTION

25       dotnet is a tool for managing .NET source code and binaries.  It expos‐
26       es commands that perform specific tasks, such as dotnet build and  dot‐
27       net  run.   Each  command defines its own arguments.  Type --help after
28       each command to access brief help documentation.
29
30       dotnet can be used to run applications, by  specifying  an  application
31       DLL,  such  as  dotnet myapp.dll.  See .NET Core application deployment
32       for to learn about deployment options.
33

OPTIONS

35   .NET Core 2.1
36       --additional-deps <PATH>
37
38       Path to additional deps.json file.
39
40       --additionalprobingpath <PATH>
41
42       Path containing probing policy and assemblies to probe.
43
44       -d|--diagnostics
45
46       Enables diagnostic output.
47
48       --fx-version <VERSION>
49
50       Version of the .NET Core runtime to use to run the application.
51
52       -h|--help
53
54       Prints out documentation for a given  command,  such  as  dotnet  build
55       --help.  dotnet --help prints a list of available commands.
56
57       --info
58
59       Prints  out detailed information about a .NET Core installation and the
60       machine environment, such as the current operating system,  and  commit
61       SHA of the .NET Core version.
62
63       --list-runtimes
64
65       Displays the installed .NET Core runtimes.
66
67       --list-sdks
68
69       Displays the installed .NET Core SDKs.
70
71       --roll-forward-on-no-candidate-fx <N>
72
73       Defines  behavior  when the required shared framework is not available.
74       N can be: * 0 - Disable even minor version roll forward.  *  1  -  Roll
75       forward  on  minor  version, but not on major version.  This is the de‐
76       fault behavior.  * 2 - Roll forward on minor and major versions.
77
78       For more information, see Roll forward.
79
80       -v|--verbosity <LEVEL>
81
82       Sets the verbosity level of the command.  Allowed values  are  q[uiet],
83       m[inimal],  n[ormal],  d[etailed],  and diag[nostic].  Not supported in
84       every command; see specific command page to determine if this option is
85       available.
86
87       --version
88
89       Prints out the version of the .NET Core SDK in use.
90
91   .NET Core 2.0
92       --additional-deps <PATH>
93
94       Path to additional deps.json file.
95
96       --additionalprobingpath <PATH>
97
98       Path containing probing policy and assemblies to probe.
99
100       -d|--diagnostics
101
102       Enables diagnostic output.
103
104       --fx-version <VERSION>
105
106       Version of the .NET Core runtime to use to run the application.
107
108       -h|--help
109
110       Prints  out  documentation  for  a  given command, such as dotnet build
111       --help.  dotnet --help prints a list of available commands.
112
113       --info
114
115       Prints out detailed information about a .NET Core installation and  the
116       machine  environment,  such as the current operating system, and commit
117       SHA of the .NET Core version.
118
119       --roll-forward-on-no-candidate-fx
120
121       Disables minor version roll forward, if set to 0.   For  more  informa‐
122       tion, see Roll forward.
123
124       -v|--verbosity <LEVEL>
125
126       Sets  the  verbosity level of the command.  Allowed values are q[uiet],
127       m[inimal], n[ormal], d[etailed], and diag[nostic].   Not  supported  in
128       every command; see specific command page to determine if this option is
129       available.
130
131       --version
132
133       Prints out the version of the .NET Core SDK in use.
134
135   .NET Core 1.x
136       --additionalprobingpath <PATH>
137
138       Path containing probing policy and assemblies to probe.
139
140       -d|--diagnostics
141
142       Enables diagnostic output.
143
144       --fx-version <VERSION>
145
146       Version of the .NET Core runtime to use to run the application.
147
148       -h|--help
149
150       Prints out documentation for a given  command,  such  as  dotnet  build
151       --help.  dotnet --help prints a list of available commands.
152
153       --info
154
155       Prints  out detailed information about a .NET Core installation and the
156       machine environment, such as the current operating system,  and  commit
157       SHA of the .NET Core version.
158
159       -v|--verbosity <LEVEL>
160
161       Sets  the  verbosity level of the command.  Allowed values are q[uiet],
162       m[inimal], n[ormal], d[etailed], and diag[nostic].   Not  supported  in
163       every command; see specific command page to determine if this option is
164       available.
165
166       --version
167
168       Prints out the version of the .NET Core SDK in use.
169
170          *   *   *   *   *
171
172   dotnet commands
173   General
174   .NET Core 2.1
175       Command               Function
176       ─────────────────────────────────────────────────
177       dotnet build          Builds a .NET Core  appli‐
178                             cation.
179       dotnet build-server   Interacts   with   servers
180                             started by a build.
181       dotnet clean          Clean build outputs.
182       dotnet help           Shows more detailed  docu‐
183                             mentation  online  for the
184                             command.
185       dotnet migrate        Migrates a valid Preview 2
186                             project to a .NET Core SDK
187                             1.0 project.
188       dotnet msbuild        Provides access to the MS‐
189                             Build command line.
190       dotnet new            Initializes  a  C#  or  F#
191                             project for a  given  tem‐
192                             plate.
193       dotnet pack           Creates a NuGet package of
194                             your code.
195       dotnet publish        Publishes  a  .NET  frame‐
196                             work-dependent   or  self-
197                             contained application.
198
199       dotnet restore        Restores the  dependencies
200                             for a given application.
201       dotnet run            Runs  the application from
202                             source.
203       dotnet sln            Options  to  add,  remove,
204                             and list projects in a so‐
205                             lution file.
206       dotnet store          Stores assemblies  in  the
207                             runtime package store.
208       dotnet test           Runs  tests  using  a test
209                             runner.
210
211   .NET Core 2.0
212       Command          Function
213       ────────────────────────────────────────────
214       dotnet build     Builds a .NET Core  appli‐
215                        cation.
216       dotnet clean     Clean build outputs.
217       dotnet help      Shows  more detailed docu‐
218                        mentation online  for  the
219                        command.
220       dotnet migrate   Migrates a valid Preview 2
221                        project to a .NET Core SDK
222                        1.0 project.
223       dotnet msbuild   Provides access to the MS‐
224                        Build command line.
225       dotnet new       Initializes  a  C#  or  F#
226                        project  for  a given tem‐
227                        plate.
228       dotnet pack      Creates a NuGet package of
229                        your code.
230       dotnet publish   Publishes  a  .NET  frame‐
231                        work-dependent  or   self-
232                        contained application.
233       dotnet restore   Restores  the dependencies
234                        for a given application.
235       dotnet run       Runs the application  from
236                        source.
237       dotnet sln       Options  to  add,  remove,
238                        and list projects in a so‐
239                        lution file.
240       dotnet store     Stores  assemblies  in the
241                        runtime package store.
242       dotnet test      Runs tests  using  a  test
243                        runner.
244
245   .NET Core 1.x
246       Command          Function
247       ────────────────────────────────────────────
248       dotnet build     Builds  a .NET Core appli‐
249                        cation.
250       dotnet clean     Clean build outputs.
251       dotnet migrate   Migrates a valid Preview 2
252                        project to a .NET Core SDK
253                        1.0 project.
254       dotnet msbuild   Provides access to the MS‐
255                        Build command line.
256       dotnet new       Initializes  a  C#  or  F#
257                        project for a  given  tem‐
258                        plate.
259       dotnet pack      Creates a NuGet package of
260                        your code.
261       dotnet publish   Publishes  a  .NET  frame‐
262                        work-dependent   or  self-
263                        contained application.
264
265       dotnet restore   Restores the  dependencies
266                        for a given application.
267       dotnet run       Runs  the application from
268                        source.
269       dotnet sln       Options  to  add,  remove,
270                        and list projects in a so‐
271                        lution file.
272       dotnet test      Runs tests  using  a  test
273                        runner.
274
275          *   *   *   *   *
276
277   Project references
278       Command                   Function
279       ─────────────────────────────────────────────────────
280       dotnet add reference      Adds a project reference.
281       dotnet list reference     Lists project references.
282       dotnet remove reference   Removes  a  project refer‐
283                                 ence.
284
285   NuGet packages
286       Command                 Function
287       ─────────────────────────────────────────────────
288       dotnet add package      Adds a NuGet package.
289       dotnet remove package   Removes a NuGet package.
290
291   NuGet commands
292       Command               Function
293       ─────────────────────────────────────────────────
294       dotnet nuget delete   Deletes or unlists a pack‐
295                             age from the server.
296       dotnet nuget locals   Clears   or   lists  local
297                             NuGet  resources  such  as
298                             http-request cache, tempo‐
299                             rary  cache,  or  machine-
300                             wide global packages fold‐
301                             er.
302       dotnet nuget push     Pushes a  package  to  the
303                             server and publishes it.
304
305   Global Tools commands
306       .NET  Core  Global  Tools  are  available  starting  with .NET Core SDK
307       2.1.300:
308
309       Command                 Function
310       ───────────────────────────────────────────────────
311       dotnet tool install     Installs a Global Tool  on
312                               your machine.
313       dotnet tool list        Lists   all  Global  Tools
314                               currently installed in the
315                               default  directory on your
316                               machine or in  the  speci‐
317                               fied path.
318       dotnet tool uninstall   Uninstalls  a  Global Tool
319                               from your machine.
320       dotnet tool update      Updates a Global  Tool  on
321                               your machine.
322
323   Additional tools
324       Starting with .NET Core SDK 2.1.300, a number of tools that were avail‐
325       able only on a per project basis using DotnetCliToolReference  are  now
326       available  as part of the .NET Core SDK.  These tools are listed in the
327       following table:
328
329       Tool           Function
330       ──────────────────────────────────────────
331       dev-certs      Creates and manages devel‐
332                      opment certificates.
333       ef             Entity Framework Core com‐
334                      mand-line tools.
335       sql-cache      SQL Server cache  command-
336                      line tools.
337       user-secrets   Manages  development  user
338                      secrets.
339       watch          Starts a file watcher that
340                      runs  a command when files
341                      change.
342
343       For more information about each tool, type dotnet <tool-name> --help.
344

EXAMPLES

346       Creates a new .NET Core console application:
347
348       dotnet new console
349
350       Restore dependencies for a given application:
351
352       dotnet restore
353
354       Build a project and its dependencies in a given directory:
355
356       dotnet build
357
358       Run an application DLL, such as myapp.dll:
359
360       dotnet myapp.dll
361

ENVIRONMENT VARIABLES

363   .NET Core 2.1
364       DOTNET_PACKAGES
365
366       The  primary   package   cache.    If   not   set,   it   defaults   to
367       $HOME/.nuget/packages on Unix or %HOME%\NuGet\Packages on Windows.
368
369       DOTNET_SERVICING
370
371       Specifies the location of the servicing index to use by the shared host
372       when loading the runtime.
373
374       DOTNET_CLI_TELEMETRY_OPTOUT
375
376       Specifies whether data about the .NET Core tools usage is collected and
377       sent  to  Microsoft.   Set  to true to opt-out of the telemetry feature
378       (values true, 1, or yes accepted).  Otherwise, set to false to opt into
379       the  telemetry features (values false, 0, or no accepted).  If not set,
380       the default is false and the telemetry feature is active.
381
382       DOTNET_MULTILEVEL_LOOKUP
383
384       Specifies whether .NET Core runtime, shared framework, or SDK  are  re‐
385       solved from the global location.  If not set, it defaults to true.  Set
386       to false to not resolve from the global location and have isolated .NET
387       Core installations (values 0 or false are accepted).  For more informa‐
388       tion about multi-level lookup, see Multi-level SharedFX Lookup.
389
390       DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX
391
392       Disables minor version roll forward, if set to 0.   For  more  informa‐
393       tion, see Roll forward.
394
395   .NET Core 2.0
396       DOTNET_PACKAGES
397
398       The   primary   package   cache.    If   not   set,   it   defaults  to
399       $HOME/.nuget/packages on Unix or %HOME%\NuGet\Packages on Windows.
400
401       DOTNET_SERVICING
402
403       Specifies the location of the servicing index to use by the shared host
404       when loading the runtime.
405
406       DOTNET_CLI_TELEMETRY_OPTOUT
407
408       Specifies whether data about the .NET Core tools usage is collected and
409       sent to Microsoft.  Set to true to opt-out  of  the  telemetry  feature
410       (values true, 1, or yes accepted).  Otherwise, set to false to opt into
411       the telemetry features (values false, 0, or no accepted).  If not  set,
412       the default is false and the telemetry feature is active.
413
414       DOTNET_MULTILEVEL_LOOKUP
415
416       Specifies  whether  .NET Core runtime, shared framework, or SDK are re‐
417       solved from the global location.  If not set, it defaults to true.  Set
418       to false to not resolve from the global location and have isolated .NET
419       Core installations (values 0 or false are accepted).  For more informa‐
420       tion about multi-level lookup, see Multi-level SharedFX Lookup.
421
422   .NET Core 1.x
423       DOTNET_PACKAGES
424
425       The   primary   package   cache.    If   not   set,   it   defaults  to
426       $HOME/.nuget/packages on Unix or %HOME%\NuGet\Packages on Windows.
427
428       DOTNET_SERVICING
429
430       Specifies the location of the servicing index to use by the shared host
431       when loading the runtime.
432
433       DOTNET_CLI_TELEMETRY_OPTOUT
434
435       Specifies whether data about the .NET Core tools usage is collected and
436       sent to Microsoft.  Set to true to opt-out  of  the  telemetry  feature
437       (values true, 1, or yes accepted).  Otherwise, set to false to opt into
438       the telemetry features (values false, 0, or no accepted).  If not  set,
439       the default is false and the telemetry feature is active.
440
441          *   *   *   *   *
442
443
444
445                                                             dotnet command(1)
Impressum