.NET CLI overview
/* The .NET command-line interface (CLI) is a cross-platform toolchain for
developing, building, running, and publishing .NET applications. */
// Basic commands
new
restore
build
publish
run
test
vstest
pack
migrate
clean
sln
help
store
// Project modification commands
add package
add reference
remove package
remove reference
list reference
// Advanced commands
nuget delete
nuget locals
nuget push
msbuild
dotnet install script
//Tool management commands
tool install
tool list
tool update
tool restore Available since .NET Core SDK 3.0.
tool run Available since .NET Core SDK 3.0.
tool uninstall
/* Command structure
CLI command structure consists of the driver ("dotnet"), the command,
and possibly command arguments and options. You see this pattern in most
CLI operations, such as creating a new console app and running it from the
command line as the following commands show when executed from a directory
named my_app: */
dotnet new console
dotnet build --output /build_output
dotnet /build_output/my_app.dll
/* Driver
The driver is named dotnet and has two responsibilities, either running a
framework-dependent app or executing a command.
To run a framework-dependent app, specify the app after the driver,
for example, 'dotnet /path/to/my_app.dll'. When executing the command from
the folder where the app's DLL resides, simply execute 'dotnet my_app.dll'.
If you want to use a specific version of the .NET Runtime, use the
'--fx-version <VERSION>' option (see the dotnet command reference).
When you supply a command to the driver, dotnet.exe starts the CLI command
execution process. For example: */
dotnet build
/* Command
The command performs an action. For example, 'dotnet build' builds code.
'dotnet publish' publishes code. The commands are implemented as a console
application using a 'dotnet {command}' convention. */
/* Arguments
The arguments you pass on the command line are the arguments to the command
invoked. For example, when you execute 'dotnet publish my_app.csproj',
the 'my_app.csproj' argument indicates the project to publish and is passed
to the 'publish' command. */
/* Options
The options you pass on the command line are the options to the command
invoked. For example, when you execute 'dotnet publish --output /build_output',
the '--output' option and its value are passed to the 'publish' command.