All apps/.NET CLI

.NET CLI

dotnet

The .NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing .NET applications.

Runs as dotnet|macOS, Linux, Windows|learn.microsoft.com

Command form

ai-draft · 8 tasks · 31 fields

Build, run, test and create .NET projects. Flags come from dotnet <command> -h; other commands are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui dotnet

dotnet build

Build project

Builds a project, solution or file-based program.

Build projectExample values, fixed in this page — nothing here reaches a terminal
Basic
Project or solution
any
Configuration
Debugstring
TasksEach one presets the form for one job
Debug build
projectconfiguration
Release build
projectconfigurationoutputruntime
ParametersOnly these flags are editable in the form
Project or solution
path · positional 0
Configuration
string
--configuration-cDebugRelease
Target framework
string
--framework-f
Runtime identifier
string
--runtime-r
Output directory
path
--output-o
Skip restore
boolean
--no-restore
Non-incremental build
boolean
--no-incremental
Self-contained
boolean
--self-contained
No banner
boolean
--no-logo

dotnet run

Run project

Builds and runs a project; app arguments after -- are not covered.

Run projectExample values, fixed in this page — nothing here reaches a terminal
Basic
Project path
any
Configuration
string
Launch profile
string
TasksEach one presets the form for one job
Run project
projectconfigurationlaunch_profile
Run without rebuild
projectno_build
ParametersOnly these flags are editable in the form
Project path
path
--project
Configuration
string
--configuration-cDebugRelease
Target framework
string
--framework-f
Launch profile
string
--launch-profile-lp
Ignore launch profile
boolean
--no-launch-profile
Skip build
boolean
--no-build
Skip restore
boolean
--no-restore

dotnet test

Run tests

Runs VSTest tests; additional runner arguments are not covered.

Run testsExample values, fixed in this page — nothing here reaches a terminal
Basic
Test filter
string
Logger
string
Configuration
string
TasksEach one presets the form for one job
Run all tests
configurationfilterlogger
Collect coverage
collectresults_directoryfilter
ParametersOnly these flags are editable in the form
Test filter
string
--filter
Logger
string
--logger-ltrxconsole;verbosity=detailed
Configuration
string
--configuration-cDebugRelease
Target framework
string
--framework-f
List tests only
boolean
--list-tests
Skip build
boolean
--no-build
Skip restore
boolean
--no-restore
Data collector
string
--collectXPlat Code Coverage
Results directory
path
--results-directory
Blame mode
boolean
--blame

dotnet new

New project from template

Instantiates a template; template-specific options are not covered.

New project from templateExample values, fixed in this page — nothing here reaches a terminal
Basic
Template short name*
consolestring
Name
string
Output directory
directory
TasksEach one presets the form for one job
Console app
templatenameoutput
Preview template
templatenamedry_run
ParametersOnly these flags are editable in the form
Template short name
string · positional 0
consoleclasslibwebapixunitslngitignore
Name
string
--name-n
Output directory
path
--output-o
Dry run
boolean
--dry-run
Overwrite existing files
boolean
--force
SourcesEvery flag above is checked against these
help-build
Description: .NET Builder Usage: dotnet build [<PROJECT | SOLUTION | FILE>...] [options] Arguments: <PROJECT | SOLUTION | FILE> The project or solution or C# (file-based program) file to operate on. If a file is not specified, the command will search the current…
help.NET SDK 10.0.401 (dotnet build -h)
help-run
Description: .NET Run Command Usage: dotnet run [<applicationArguments>...] [options] Arguments: <applicationArguments> Arguments passed to the application that is being run. [] Options: -c, --configuration <CONFIGURATION> The configuration to run for. The default for most pr…
help.NET SDK 10.0.401 (dotnet run -h)
help-test
Description: .NET Test Command for VSTest. To use Microsoft.Testing.Platform, opt-in to the Microsoft.Testing.Platform-based command via global.json. For more information, see https://aka.ms/dotnet-test. Usage: dotnet test [options] [[--] <additional arguments>...]] Options: -s, --settings <SETTINGS_FILE> The settings file to use when runni…
help.NET SDK 10.0.401 (dotnet test -h)
help-new
Description: Template Instantiation Commands for .NET CLI. Usage: dotnet new [<template-short-name> [<template-args>...]] [options] dotnet new [command] [options] Arguments: <template-short-name> A short name of the template to create. <template-args> Template specific options to use. Options: -o, --output <output> Location to place…
help.NET SDK 10.0.401 (dotnet new -h)
help-build
Description: .NET Builder Usage: dotnet build [<PROJECT | SOLUTION | FILE>...] [options] Arguments: <PROJECT | SOLUTION | FILE> The project or solution or C# (file-based program) file to operate on. If a file is not specified, the command will search the current…
help.NET SDK 10.0.401 (dotnet build -h)
help-run
Description: .NET Run Command Usage: dotnet run [<applicationArguments>...] [options] Arguments: <applicationArguments> Arguments passed to the application that is being run. [] Options: -c, --configuration <CONFIGURATION> The configuration to run for. The default for most pr…
help.NET SDK 10.0.401 (dotnet run -h)
help-test
Description: .NET Test Command for VSTest. To use Microsoft.Testing.Platform, opt-in to the Microsoft.Testing.Platform-based command via global.json. For more information, see https://aka.ms/dotnet-test. Usage: dotnet test [options] [[--] <additional arguments>...]] Options: -s, --settings <SETTINGS_FILE> The settings file to use when runni…
help.NET SDK 10.0.401 (dotnet test -h)
help-new
Description: Template Instantiation Commands for .NET CLI. Usage: dotnet new [<template-short-name> [<template-args>...]] [options] dotnet new [command] [options] Arguments: <template-short-name> A short name of the template to create. <template-args> Template specific options to use. Options: -o, --output <output> Location to place…
help.NET SDK 10.0.401 (dotnet new -h)

Before it fills your prompt, Otty checks the installed dotnet against its version. A form that does not match your version is not offered.