id = "dotnet"
name = ".NET CLI"
homepage = "https://learn.microsoft.com/en-us/dotnet/core/tools/"
description = "The .NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing .NET applications."
icon = "SimpleIcons:dotnet"
executables = ["dotnet"]
[dotfiles]
paths = [
"~/.nuget/NuGet/NuGet.Config",
"%APPDATA%/NuGet/NuGet.Config",
]
exclude = [
"~/.nuget/packages/",
"~/.dotnet/",
]
secret = []
side_effect = false
[[dotfiles.secret_paths]]
file = ["~/.nuget/NuGet/NuGet.Config", "%APPDATA%/NuGet/NuGet.Config"]
match = { prefix = ["<add key=\"ClearTextPassword\"", "<add key=\"Password\""] }
[[dotfiles.machine_lines]]
file = ["~/.nuget/NuGet/NuGet.Config", "%APPDATA%/NuGet/NuGet.Config"]
match = { prefix = ["<add key=\"globalPackagesFolder\"", "<add key=\"repositoryPath\""] }
scope = "backup"
[commands]
format = 1
label = ".NET CLI"
description = "Build, run, test and create .NET projects. Flags come from dotnet <command> -h; other commands are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "help-build"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet build -h)"
evidence = """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
directory for a project or solution.
Options:
--ucr, --use-current-runtime Use current runtime as the target
runtime. [default: False]
-f, --framework <FRAMEWORK> The target framework to build for. The
target framework must also be specified
in the project file.
-c, --configuration <CONFIGURATION> The configuration to use for building
the project. The default for most
projects is 'Debug'.
--version-suffix <VERSION_SUFFIX> Set the value of the $(VersionSuffix)
property to use when building the
project.
--no-restore Do not restore the project before
building. [default: False]
--interactive Allows the command to stop and wait for
user input or action (for example to
complete authentication). [default:
False]
-v, -verbosity <LEVEL> Set the MSBuild verbosity level. Allowed
values are q[uiet], m[inimal], n[ormal],
d[etailed], and diag[nostic].
-o, --output <OUTPUT_DIR> The output directory to place built
artifacts in.
--artifacts-path <ARTIFACTS_DIR> The artifacts path. All output from the
project, including build, publish, and
pack output, will go in subfolders under
the specified path.
--no-incremental Do not use incremental building.
[default: False]
--no-dependencies Do not build project-to-project
references and only build the specified
project. [default: False]
-nologo, --no-logo Do not display the startup banner or the
copyright message. [default: True]
--sc, --self-contained Publish the .NET runtime with your
application so the runtime doesn't need
to be installed on the target machine.
The default is 'false.' However, when
targeting .NET 7 or lower, the default
is 'true' if a runtime identifier is
specified. [default: False]
--no-self-contained Publish your application as a framework
dependent application. A compatible .NET
runtime must be installed on the target
machine to run your application.
[default: False]
-r, --runtime <RUNTIME_IDENTIFIER> The target runtime to build for.
-a, --arch <ARCH> The target architecture.
--os <OS> The target operating system.
--disable-build-servers Force the command to ignore any
persistent build servers. [default:
False]
-?, -h, --help Show command line help.
"""
[[commands.source]]
id = "help-run"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet run -h)"
evidence = """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 projects is 'Debug'.
-f, --framework <FRAMEWORK> The target framework to run for. The
target framework must also be
specified in the project file.
--project <PROJECT_PATH> Defines the path of the project file
to run. Use path to the project file,
or path to the directory containing
the project file. If not specified,
it defaults to the current directory.
--file <FILE_PATH> The path to the file-based app to run
(can be also passed as the first
argument if there is no project in
the current directory).
-lp, --launch-profile <LAUNCH_PROFILE> The name of the launch profile (if
any) to use when launching the
application.
--no-launch-profile Do not attempt to use
launchSettings.json or [app].run.json
to configure the application.
[default: False]
--device <DEVICE> The device identifier to use for
running the application.
--list-devices List available devices for running
the application. [default: False]
--no-build Do not build the project before
running. Implies --no-restore.
[default: False]
--interactive Allows the command to stop and wait
for user input or action (for example
to complete authentication).
[default: False]
--no-restore Do not restore the project before
building. [default: False]
--no-cache Skip up to date checks and always
build the program before running.
[default: False]
--sc, --self-contained Publish the .NET runtime with your
application so the runtime doesn't
need to be installed on the target
machine.
The default is 'false.' However, when
targeting .NET 7 or lower, the
default is 'true' if a runtime
identifier is specified. [default:
False]
--no-self-contained Publish your application as a
framework dependent application. A
compatible .NET runtime must be
installed on the target machine to
run your application. [default:
False]
-v, -verbosity <LEVEL> Set the MSBuild verbosity level.
Allowed values are q[uiet],
m[inimal], n[ormal], d[etailed], and
diag[nostic].
-r, --runtime <RUNTIME_IDENTIFIER> The target runtime to run for.
-a, --arch <ARCH> The target architecture.
--os <OS> The target operating system.
--disable-build-servers Force the command to ignore any
persistent build servers. [default:
False]
--artifacts-path <ARTIFACTS_DIR> The artifacts path. All output from
the project, including build,
publish, and pack output, will go in
subfolders under the specified path.
-e, --environment <NAME="VALUE"> Sets the value of an environment
variable.
Creates the variable if it does not
exist, overrides if it does.
This argument can be specified
multiple times to provide multiple
variables.
Examples:
-e VARIABLE=abc
-e VARIABLE="value with spaces"
-e VARIABLE="value;seperated
with;semicolons"
-e VAR1=abc -e VAR2=def -e VAR3=ghi
-?, -h, --help Show command line help.
"""
[[commands.source]]
id = "help-test"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet test -h)"
evidence = """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 running
tests.
-t, --list-tests List the discovered tests instead of
running the tests. [default: False]
-e, --environment <NAME="VALUE"> Sets the value of an environment
variable.
Creates the variable if it does not
exist, overrides if it does.
This will force the tests to be run in
an isolated process.
This argument can be specified multiple
times to provide multiple variables.
Examples:
-e VARIABLE=abc
-e VARIABLE="value with spaces"
-e VARIABLE="value;seperated
with;semicolons"
-e VAR1=abc -e VAR2=def -e VAR3=ghi
--filter <EXPRESSION> Run tests that match the given
expression.
Examples:
Run tests with priority set to 1:
--filter "Priority = 1"
Run a test with the specified full name:
--filter
"FullyQualifiedName=Namespace.ClassName.M
ethodName"
Run tests that contain the specified
name: --filter
"FullyQualifiedName~Namespace.Class"
See https://aka.ms/vstest-filtering for
more information on filtering support.
--test-adapter-path <ADAPTER_PATH> The path to the custom adapters to use
for the test run.
-l, --logger <LOGGER> The logger to use for test results.
Examples:
Log in trx format using a unique file
name: --logger trx
Log in trx format using the specified
file name: --logger
"trx;LogFileName=<TestResults.trx>"
See https://aka.ms/vstest-report for
more information on logger arguments.
-o, --output <OUTPUT_DIR> The output directory to place built
artifacts in.
--artifacts-path <ARTIFACTS_DIR> The artifacts path. All output from the
project, including build, publish, and
pack output, will go in subfolders under
the specified path.
-d, --diag <LOG_FILE> Enable verbose logging to the specified
file.
--no-build Do not build the project before testing.
Implies --no-restore. [default: False]
--results-directory <RESULTS_DIR> The directory where the test results
will be placed.
The specified directory will be created
if it does not exist.
--collect <DATA_COLLECTOR_NAME> The friendly name of the data collector
to use for the test run.
More info here:
https://aka.ms/vstest-collect
--blame Runs the tests in blame mode. This
option is helpful in isolating
problematic tests that cause the test
host to crash or hang, but it does not
create a memory dump by default.
When a crash is detected, it creates an
sequence file in
TestResults/guid/guid_Sequence.xml that
captures the order of tests that were
run before the crash.
Based on the additional settings, hang
dump or crash dump can also be
collected.
Example:
Timeout the test run when test takes
more than the default timeout of 1 hour,
and collect crash dump when the test
host exits unexpectedly.
(Crash dumps require additional setup,
see below.)
dotnet test --blame-hang --blame-crash
Example:
Timeout the test run when a test takes
more than 20 minutes and collect hang
dump.
dotnet test --blame-hang-timeout 20min
[default: False]
--blame-crash Runs the tests in blame mode and
collects a crash dump when the test host
exits unexpectedly. This option depends
on the version of .NET used, the type of
error, and the operating system.
For exceptions in managed code, a dump
will be automatically collected on .NET
5.0 and later versions. It will generate
a dump for testhost or any child process
that also ran on .NET 5.0 and crashed.
Crashes in native code will not generate
a dump. This option works on Windows,
macOS, and Linux.
Crash dumps in native code, or when
targetting .NET Framework, or .NET Core
3.1 and earlier versions, can only be
collected on Windows, by using Procdump.
A directory that contains procdump.exe
and procdump64.exe must be in the PATH
or PROCDUMP_PATH environment variable.
The tools can be downloaded here:
https://docs.microsoft.com/sysinternals/d
ownloads/procdump
To collect a crash dump from a native
application running on .NET 5.0 or
later, the usage of Procdump can be
forced by setting the
VSTEST_DUMP_FORCEPROCDUMP environment
variable to 1.
Implies --blame. [default: False]
--blame-crash-dump-type <DUMP_TYPE> The type of crash dump to be collected.
Supported values are full (default) and
mini. Implies --blame-crash.
--blame-crash-collect-always Enables collecting crash dump on
expected as well as unexpected testhost
exit. [default: False]
--blame-hang Run the tests in blame mode and enables
collecting hang dump when test exceeds
the given timeout. [default: False]
--blame-hang-dump-type <DUMP_TYPE> The type of crash dump to be collected.
The supported values are full (default),
mini, and none. When 'none' is used then
test host is terminated on timeout, but
no dump is collected. Implies
--blame-hang.
--blame-hang-timeout <TIMESPAN> Per-test timeout, after which hang dump
is triggered and the testhost process is
terminated. Default is 1h.
The timeout value is specified in the
following format: 1.5h / 90m / 5400s /
5400000ms. When no unit is used (e.g.
5400000), the value is assumed to be in
milliseconds.
When used together with data driven
tests, the timeout behavior depends on
the test adapter used. For xUnit, NUnit
and MSTest 2.2.4+ the timeout is renewed
after every test case,
For MSTest before 2.2.4, the timeout is
used for all testcases.
-nologo, --no-logo Run test(s), without displaying
Microsoft Testplatform banner [default:
True]
-c, --configuration <CONFIGURATION> The configuration to use for running
tests. The default for most projects is
'Debug'.
-f, --framework <FRAMEWORK> The target framework to run tests for.
The target framework must also be
specified in the project file.
--no-restore Do not restore the project before
building. [default: False]
--interactive Allows the command to stop and wait for
user input or action (for example to
complete authentication). [default:
False]
-v, -verbosity <LEVEL> Set the MSBuild verbosity level. Allowed
values are q[uiet], m[inimal], n[ormal],
d[etailed], and diag[nostic].
-r, --runtime <RUNTIME_IDENTIFIER> The target runtime to test for.
-a, --arch <ARCH> The target architecture.
--os <OS> The target operating system.
--disable-build-servers Force the command to ignore any
persistent build servers. [default:
False]
-?, -h, --help Show command line help.
Additional Arguments:
Arguments passed to the application that is being run.
"""
[[commands.source]]
id = "help-new"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet new -h)"
evidence = """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 the generated output.
-n, --name <name> The name for the output being created. If no name is
specified, the name of the output directory is used.
--dry-run Displays a summary of what would happen if the given
command line were run if it would result in a
template creation. [default: False]
--force Forces content to be generated even if it would
change existing files. [default: False]
--no-update-check Disables checking for the template package updates
when instantiating a template. [default: False]
--project <project> The project that should be used for context
evaluation.
-v, --verbosity <LEVEL> Sets the verbosity level. Allowed values are
q[uiet], m[inimal], n[ormal], and diag[nostic].
[default: normal]
-d, --diagnostics Enables diagnostic output. [default: False]
-?, -h, --help Show command line help.
Commands:
create <template-short-name> Instantiates a template with given short name.
<template-args> An alias of 'dotnet new <template name>'.
install <package> Installs a template package.
uninstall <package> Uninstalls a template package.
update Checks the currently installed template
packages for update, and install the updates.
search <template-name> Searches for the templates on NuGet.org.
list <template-name> Lists templates containing the specified
template name. If no name is specified, lists
all templates.
details <package-identifier> Provides the details for specified template
package.
The command checks if the package is
installed locally, if it was not found, it
searches the configured NuGet feeds.
"""
[[commands.subcommand]]
path = ["build"]
label = "Build project"
description = "Builds a project, solution or file-based program."
[[commands.subcommand.source]]
id = "help-build"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet build -h)"
evidence = """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
directory for a project or solution.
Options:
--ucr, --use-current-runtime Use current runtime as the target
runtime. [default: False]
-f, --framework <FRAMEWORK> The target framework to build for. The
target framework must also be specified
in the project file.
-c, --configuration <CONFIGURATION> The configuration to use for building
the project. The default for most
projects is 'Debug'.
--version-suffix <VERSION_SUFFIX> Set the value of the $(VersionSuffix)
property to use when building the
project.
--no-restore Do not restore the project before
building. [default: False]
--interactive Allows the command to stop and wait for
user input or action (for example to
complete authentication). [default:
False]
-v, -verbosity <LEVEL> Set the MSBuild verbosity level. Allowed
values are q[uiet], m[inimal], n[ormal],
d[etailed], and diag[nostic].
-o, --output <OUTPUT_DIR> The output directory to place built
artifacts in.
--artifacts-path <ARTIFACTS_DIR> The artifacts path. All output from the
project, including build, publish, and
pack output, will go in subfolders under
the specified path.
--no-incremental Do not use incremental building.
[default: False]
--no-dependencies Do not build project-to-project
references and only build the specified
project. [default: False]
-nologo, --no-logo Do not display the startup banner or the
copyright message. [default: True]
--sc, --self-contained Publish the .NET runtime with your
application so the runtime doesn't need
to be installed on the target machine.
The default is 'false.' However, when
targeting .NET 7 or lower, the default
is 'true' if a runtime identifier is
specified. [default: False]
--no-self-contained Publish your application as a framework
dependent application. A compatible .NET
runtime must be installed on the target
machine to run your application.
[default: False]
-r, --runtime <RUNTIME_IDENTIFIER> The target runtime to build for.
-a, --arch <ARCH> The target architecture.
--os <OS> The target operating system.
--disable-build-servers Force the command to ignore any
persistent build servers. [default:
False]
-?, -h, --help Show command line help.
"""
[[commands.subcommand.field]]
id = "project"
label = "Project or solution"
type = "path"
position = 0
path = { kind = "any", role = "input" }
sources = ["help-build"]
[[commands.subcommand.field]]
id = "configuration"
label = "Configuration"
type = "string"
option = ["--configuration", "-c"]
suggestions = [{ value = "Debug", label = "Debug" }, { value = "Release", label = "Release" }]
sources = ["help-build"]
[[commands.subcommand.field]]
id = "framework"
label = "Target framework"
type = "string"
option = ["--framework", "-f"]
sources = ["help-build"]
[[commands.subcommand.field]]
id = "runtime"
label = "Runtime identifier"
type = "string"
option = ["--runtime", "-r"]
sources = ["help-build"]
[[commands.subcommand.field]]
id = "output"
label = "Output directory"
type = "path"
option = ["--output", "-o"]
path = { kind = "directory", role = "output" }
sources = ["help-build"]
[[commands.subcommand.field]]
id = "no_restore"
label = "Skip restore"
type = "boolean"
option = ["--no-restore"]
sources = ["help-build"]
[[commands.subcommand.field]]
id = "no_incremental"
label = "Non-incremental build"
type = "boolean"
option = ["--no-incremental"]
sources = ["help-build"]
[[commands.subcommand.field]]
id = "self_contained"
label = "Self-contained"
type = "boolean"
option = ["--self-contained"]
sources = ["help-build"]
[[commands.subcommand.field]]
id = "no_logo"
label = "No banner"
type = "boolean"
option = ["--no-logo"]
sources = ["help-build"]
[[commands.subcommand.task]]
id = "debug"
label = "Debug build"
set = { configuration = ["Debug"] }
fields = ["project", "configuration"]
required = []
[[commands.subcommand.task]]
id = "release"
label = "Release build"
set = { configuration = ["Release"] }
fields = ["project", "configuration", "output", "runtime"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["project", "configuration", "output"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["no_restore", "no_incremental", "self_contained", "no_logo", "runtime", "framework"]
[[commands.subcommand]]
path = ["run"]
label = "Run project"
description = "Builds and runs a project; app arguments after -- are not covered."
[[commands.subcommand.source]]
id = "help-run"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet run -h)"
evidence = """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 projects is 'Debug'.
-f, --framework <FRAMEWORK> The target framework to run for. The
target framework must also be
specified in the project file.
--project <PROJECT_PATH> Defines the path of the project file
to run. Use path to the project file,
or path to the directory containing
the project file. If not specified,
it defaults to the current directory.
--file <FILE_PATH> The path to the file-based app to run
(can be also passed as the first
argument if there is no project in
the current directory).
-lp, --launch-profile <LAUNCH_PROFILE> The name of the launch profile (if
any) to use when launching the
application.
--no-launch-profile Do not attempt to use
launchSettings.json or [app].run.json
to configure the application.
[default: False]
--device <DEVICE> The device identifier to use for
running the application.
--list-devices List available devices for running
the application. [default: False]
--no-build Do not build the project before
running. Implies --no-restore.
[default: False]
--interactive Allows the command to stop and wait
for user input or action (for example
to complete authentication).
[default: False]
--no-restore Do not restore the project before
building. [default: False]
--no-cache Skip up to date checks and always
build the program before running.
[default: False]
--sc, --self-contained Publish the .NET runtime with your
application so the runtime doesn't
need to be installed on the target
machine.
The default is 'false.' However, when
targeting .NET 7 or lower, the
default is 'true' if a runtime
identifier is specified. [default:
False]
--no-self-contained Publish your application as a
framework dependent application. A
compatible .NET runtime must be
installed on the target machine to
run your application. [default:
False]
-v, -verbosity <LEVEL> Set the MSBuild verbosity level.
Allowed values are q[uiet],
m[inimal], n[ormal], d[etailed], and
diag[nostic].
-r, --runtime <RUNTIME_IDENTIFIER> The target runtime to run for.
-a, --arch <ARCH> The target architecture.
--os <OS> The target operating system.
--disable-build-servers Force the command to ignore any
persistent build servers. [default:
False]
--artifacts-path <ARTIFACTS_DIR> The artifacts path. All output from
the project, including build,
publish, and pack output, will go in
subfolders under the specified path.
-e, --environment <NAME="VALUE"> Sets the value of an environment
variable.
Creates the variable if it does not
exist, overrides if it does.
This argument can be specified
multiple times to provide multiple
variables.
Examples:
-e VARIABLE=abc
-e VARIABLE="value with spaces"
-e VARIABLE="value;seperated
with;semicolons"
-e VAR1=abc -e VAR2=def -e VAR3=ghi
-?, -h, --help Show command line help.
"""
[[commands.subcommand.field]]
id = "project"
label = "Project path"
type = "path"
option = ["--project"]
path = { kind = "any", role = "input" }
sources = ["help-run"]
[[commands.subcommand.field]]
id = "configuration"
label = "Configuration"
type = "string"
option = ["--configuration", "-c"]
suggestions = [{ value = "Debug", label = "Debug" }, { value = "Release", label = "Release" }]
sources = ["help-run"]
[[commands.subcommand.field]]
id = "framework"
label = "Target framework"
type = "string"
option = ["--framework", "-f"]
sources = ["help-run"]
[[commands.subcommand.field]]
id = "launch_profile"
label = "Launch profile"
type = "string"
option = ["--launch-profile", "-lp"]
sources = ["help-run"]
[[commands.subcommand.field]]
id = "no_launch_profile"
label = "Ignore launch profile"
type = "boolean"
option = ["--no-launch-profile"]
sources = ["help-run"]
[[commands.subcommand.field]]
id = "no_build"
label = "Skip build"
type = "boolean"
option = ["--no-build"]
sources = ["help-run"]
[[commands.subcommand.field]]
id = "no_restore"
label = "Skip restore"
type = "boolean"
option = ["--no-restore"]
sources = ["help-run"]
[[commands.subcommand.task]]
id = "run"
label = "Run project"
fields = ["project", "configuration", "launch_profile"]
required = []
[[commands.subcommand.task]]
id = "fast"
label = "Run without rebuild"
set = { no_build = [true] }
fields = ["project", "no_build"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["project", "configuration", "launch_profile", "no_build"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["framework", "no_launch_profile", "no_restore"]
[[commands.subcommand]]
path = ["test"]
label = "Run tests"
description = "Runs VSTest tests; additional runner arguments are not covered."
[[commands.subcommand.source]]
id = "help-test"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet test -h)"
evidence = """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 running
tests.
-t, --list-tests List the discovered tests instead of
running the tests. [default: False]
-e, --environment <NAME="VALUE"> Sets the value of an environment
variable.
Creates the variable if it does not
exist, overrides if it does.
This will force the tests to be run in
an isolated process.
This argument can be specified multiple
times to provide multiple variables.
Examples:
-e VARIABLE=abc
-e VARIABLE="value with spaces"
-e VARIABLE="value;seperated
with;semicolons"
-e VAR1=abc -e VAR2=def -e VAR3=ghi
--filter <EXPRESSION> Run tests that match the given
expression.
Examples:
Run tests with priority set to 1:
--filter "Priority = 1"
Run a test with the specified full name:
--filter
"FullyQualifiedName=Namespace.ClassName.M
ethodName"
Run tests that contain the specified
name: --filter
"FullyQualifiedName~Namespace.Class"
See https://aka.ms/vstest-filtering for
more information on filtering support.
--test-adapter-path <ADAPTER_PATH> The path to the custom adapters to use
for the test run.
-l, --logger <LOGGER> The logger to use for test results.
Examples:
Log in trx format using a unique file
name: --logger trx
Log in trx format using the specified
file name: --logger
"trx;LogFileName=<TestResults.trx>"
See https://aka.ms/vstest-report for
more information on logger arguments.
-o, --output <OUTPUT_DIR> The output directory to place built
artifacts in.
--artifacts-path <ARTIFACTS_DIR> The artifacts path. All output from the
project, including build, publish, and
pack output, will go in subfolders under
the specified path.
-d, --diag <LOG_FILE> Enable verbose logging to the specified
file.
--no-build Do not build the project before testing.
Implies --no-restore. [default: False]
--results-directory <RESULTS_DIR> The directory where the test results
will be placed.
The specified directory will be created
if it does not exist.
--collect <DATA_COLLECTOR_NAME> The friendly name of the data collector
to use for the test run.
More info here:
https://aka.ms/vstest-collect
--blame Runs the tests in blame mode. This
option is helpful in isolating
problematic tests that cause the test
host to crash or hang, but it does not
create a memory dump by default.
When a crash is detected, it creates an
sequence file in
TestResults/guid/guid_Sequence.xml that
captures the order of tests that were
run before the crash.
Based on the additional settings, hang
dump or crash dump can also be
collected.
Example:
Timeout the test run when test takes
more than the default timeout of 1 hour,
and collect crash dump when the test
host exits unexpectedly.
(Crash dumps require additional setup,
see below.)
dotnet test --blame-hang --blame-crash
Example:
Timeout the test run when a test takes
more than 20 minutes and collect hang
dump.
dotnet test --blame-hang-timeout 20min
[default: False]
--blame-crash Runs the tests in blame mode and
collects a crash dump when the test host
exits unexpectedly. This option depends
on the version of .NET used, the type of
error, and the operating system.
For exceptions in managed code, a dump
will be automatically collected on .NET
5.0 and later versions. It will generate
a dump for testhost or any child process
that also ran on .NET 5.0 and crashed.
Crashes in native code will not generate
a dump. This option works on Windows,
macOS, and Linux.
Crash dumps in native code, or when
targetting .NET Framework, or .NET Core
3.1 and earlier versions, can only be
collected on Windows, by using Procdump.
A directory that contains procdump.exe
and procdump64.exe must be in the PATH
or PROCDUMP_PATH environment variable.
The tools can be downloaded here:
https://docs.microsoft.com/sysinternals/d
ownloads/procdump
To collect a crash dump from a native
application running on .NET 5.0 or
later, the usage of Procdump can be
forced by setting the
VSTEST_DUMP_FORCEPROCDUMP environment
variable to 1.
Implies --blame. [default: False]
--blame-crash-dump-type <DUMP_TYPE> The type of crash dump to be collected.
Supported values are full (default) and
mini. Implies --blame-crash.
--blame-crash-collect-always Enables collecting crash dump on
expected as well as unexpected testhost
exit. [default: False]
--blame-hang Run the tests in blame mode and enables
collecting hang dump when test exceeds
the given timeout. [default: False]
--blame-hang-dump-type <DUMP_TYPE> The type of crash dump to be collected.
The supported values are full (default),
mini, and none. When 'none' is used then
test host is terminated on timeout, but
no dump is collected. Implies
--blame-hang.
--blame-hang-timeout <TIMESPAN> Per-test timeout, after which hang dump
is triggered and the testhost process is
terminated. Default is 1h.
The timeout value is specified in the
following format: 1.5h / 90m / 5400s /
5400000ms. When no unit is used (e.g.
5400000), the value is assumed to be in
milliseconds.
When used together with data driven
tests, the timeout behavior depends on
the test adapter used. For xUnit, NUnit
and MSTest 2.2.4+ the timeout is renewed
after every test case,
For MSTest before 2.2.4, the timeout is
used for all testcases.
-nologo, --no-logo Run test(s), without displaying
Microsoft Testplatform banner [default:
True]
-c, --configuration <CONFIGURATION> The configuration to use for running
tests. The default for most projects is
'Debug'.
-f, --framework <FRAMEWORK> The target framework to run tests for.
The target framework must also be
specified in the project file.
--no-restore Do not restore the project before
building. [default: False]
--interactive Allows the command to stop and wait for
user input or action (for example to
complete authentication). [default:
False]
-v, -verbosity <LEVEL> Set the MSBuild verbosity level. Allowed
values are q[uiet], m[inimal], n[ormal],
d[etailed], and diag[nostic].
-r, --runtime <RUNTIME_IDENTIFIER> The target runtime to test for.
-a, --arch <ARCH> The target architecture.
--os <OS> The target operating system.
--disable-build-servers Force the command to ignore any
persistent build servers. [default:
False]
-?, -h, --help Show command line help.
Additional Arguments:
Arguments passed to the application that is being run.
"""
[[commands.subcommand.field]]
id = "filter"
label = "Test filter"
type = "string"
option = ["--filter"]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "logger"
label = "Logger"
type = "string"
option = ["--logger", "-l"]
suggestions = [{ value = "trx", label = "trx" }, { value = "console;verbosity=detailed", label = "console;verbosity=detailed" }]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "configuration"
label = "Configuration"
type = "string"
option = ["--configuration", "-c"]
suggestions = [{ value = "Debug", label = "Debug" }, { value = "Release", label = "Release" }]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "framework"
label = "Target framework"
type = "string"
option = ["--framework", "-f"]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "list_tests"
label = "List tests only"
type = "boolean"
option = ["--list-tests"]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "no_build"
label = "Skip build"
type = "boolean"
option = ["--no-build"]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "no_restore"
label = "Skip restore"
type = "boolean"
option = ["--no-restore"]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "collect"
label = "Data collector"
type = "string"
option = ["--collect"]
suggestions = [{ value = "XPlat Code Coverage", label = "XPlat Code Coverage" }]
sources = ["help-test"]
[[commands.subcommand.field]]
id = "results_directory"
label = "Results directory"
type = "path"
option = ["--results-directory"]
path = { kind = "directory", role = "output" }
sources = ["help-test"]
[[commands.subcommand.field]]
id = "blame"
label = "Blame mode"
type = "boolean"
option = ["--blame"]
sources = ["help-test"]
[[commands.subcommand.task]]
id = "test"
label = "Run all tests"
fields = ["configuration", "filter", "logger"]
required = []
[[commands.subcommand.task]]
id = "coverage"
label = "Collect coverage"
set = { collect = ["XPlat Code Coverage"] }
fields = ["collect", "results_directory", "filter"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["filter", "logger", "configuration", "list_tests", "no_build", "collect"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["framework", "no_restore", "blame", "results_directory"]
[[commands.subcommand]]
path = ["new"]
label = "New project from template"
description = "Instantiates a template; template-specific options are not covered."
[[commands.subcommand.source]]
id = "help-new"
kind = "help"
revision = ".NET SDK 10.0.401 (dotnet new -h)"
evidence = """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 the generated output.
-n, --name <name> The name for the output being created. If no name is
specified, the name of the output directory is used.
--dry-run Displays a summary of what would happen if the given
command line were run if it would result in a
template creation. [default: False]
--force Forces content to be generated even if it would
change existing files. [default: False]
--no-update-check Disables checking for the template package updates
when instantiating a template. [default: False]
--project <project> The project that should be used for context
evaluation.
-v, --verbosity <LEVEL> Sets the verbosity level. Allowed values are
q[uiet], m[inimal], n[ormal], and diag[nostic].
[default: normal]
-d, --diagnostics Enables diagnostic output. [default: False]
-?, -h, --help Show command line help.
Commands:
create <template-short-name> Instantiates a template with given short name.
<template-args> An alias of 'dotnet new <template name>'.
install <package> Installs a template package.
uninstall <package> Uninstalls a template package.
update Checks the currently installed template
packages for update, and install the updates.
search <template-name> Searches for the templates on NuGet.org.
list <template-name> Lists templates containing the specified
template name. If no name is specified, lists
all templates.
details <package-identifier> Provides the details for specified template
package.
The command checks if the package is
installed locally, if it was not found, it
searches the configured NuGet feeds.
"""
[[commands.subcommand.field]]
id = "template"
label = "Template short name"
type = "string"
position = 0
suggestions = [{ value = "console", label = "console" }, { value = "classlib", label = "classlib" }, { value = "webapi", label = "webapi" }, { value = "xunit", label = "xunit" }, { value = "sln", label = "sln" }, { value = "gitignore", label = "gitignore" }]
sources = ["help-new"]
[[commands.subcommand.field]]
id = "name"
label = "Name"
type = "string"
option = ["--name", "-n"]
sources = ["help-new"]
[[commands.subcommand.field]]
id = "output"
label = "Output directory"
type = "path"
option = ["--output", "-o"]
path = { kind = "directory", role = "output" }
sources = ["help-new"]
[[commands.subcommand.field]]
id = "dry_run"
label = "Dry run"
type = "boolean"
option = ["--dry-run"]
sources = ["help-new"]
[[commands.subcommand.field]]
id = "force"
label = "Overwrite existing files"
type = "boolean"
option = ["--force"]
effect = "overwrite"
sources = ["help-new"]
[[commands.subcommand.task]]
id = "console"
label = "Console app"
set = { template = ["console"] }
fields = ["template", "name", "output"]
required = ["template"]
[[commands.subcommand.task]]
id = "dry"
label = "Preview template"
set = { dry_run = [true] }
fields = ["template", "name", "dry_run"]
required = ["template"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["template", "name", "output", "dry_run", "force"]