Skip to content

Instantly share code, notes, and snippets.

@AdmiringWorm
Created March 19, 2017 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdmiringWorm/34d342991d8aab56fb11ac513dd5d670 to your computer and use it in GitHub Desktop.
Save AdmiringWorm/34d342991d8aab56fb11ac513dd5d670 to your computer and use it in GitHub Desktop.
dotnet 1.1.0.1179 help pages
Usage: dotnet add [arguments] [options] [command]
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
Options:
-h|--help Show help information
Commands:
package Command to add package reference
reference Command to add project to project reference
Use "dotnet add [command] --help" for more information about a command.
Usage: dotnet build [arguments] [options] [args]
Arguments:
<PROJECT> The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file.
Options:
-h|--help Show help information
-o|--output <OUTPUT_DIR> Output directory in which to place built artifacts.
-f|--framework <FRAMEWORK> Target framework to build for. The target framework has to be specified in the project file.
-r|--runtime <RUNTIME_IDENTIFIER> Target runtime to build for. The default is to build a portable application.
-c|--configuration <CONFIGURATION> Configuration to use for building the project. Default for most projects is "Debug".
--version-suffix <VERSION_SUFFIX> Defines the value for the $(VersionSuffix) property in the project
--no-incremental Disables incremental build.
--no-dependencies Set this flag to ignore project-to-project references and only build the root project
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Additional Arguments:
Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options.
Usage: dotnet clean [arguments] [options] [args]
Arguments:
<PROJECT> The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file.
Options:
-h|--help Show help information
-o|--output <OUTPUT_DIR> Directory in which the build outputs have been placed.
-f|--framework <FRAMEWORK> Clean a specific framework.
-c|--configuration <CONFIGURATION> Clean a specific configuration.
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Additional Arguments:
Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options.
Usage: dotnet list [arguments] [options] [command]
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
Options:
-h|--help Show help information
Commands:
reference Command to list project to project references
Use "dotnet list [command] --help" for more information about a command.
Usage: dotnet migrate [arguments] [options]
Arguments:
<PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR> The path to one of the following:
- a project.json file to migrate.
- a global.json file, it will migrate the folders specified in global.json.
- a solution.sln file, it will migrate the projects referenced in the solution.
- a directory to migrate, it will recursively search for project.json files to migrate.
Defaults to current directory if nothing is specified.
Options:
-h|--help Show help information
-t|--template-file Base MSBuild template to use for migrated app. The default is the project included in dotnet new.
-v|--sdk-package-version The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new.
-x|--xproj-file The path to the xproj file to use. Required when there is more than one xproj in a project directory.
-s|--skip-project-references Skip migrating project references. By default project references are migrated recursively.
-r|--report-file Output migration report to the given file in addition to the console.
--format-report-file-json Output migration report file as json rather than user messages.
--skip-backup Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration.
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
Syntax: MSBuild.exe [options] [project file | directory]
Description: Builds the specified targets in the project file. If
a project file is not specified, MSBuild searches the
current working directory for a file that has a file
extension that ends in "proj" and uses that file. If
a directory is specified, MSBuild searches that
directory for a project file.
Switches:
/target:<targets> Build these targets in this project. Use a semicolon or a
comma to separate multiple targets, or specify each
target separately. (Short form: /t)
Example:
/target:Resources;Compile
/property:<n>=<v> Set or override these project-level properties. <n> is
the property name, and <v> is the property value. Use a
semicolon or a comma to separate multiple properties, or
specify each property separately. (Short form: /p)
Example:
/property:WarningLevel=2;OutDir=bin\Debug\
/maxcpucount[:n] Specifies the maximum number of concurrent processes to
build with. If the switch is not used, the default
value used is 1. If the switch is used without a value
MSBuild will use up to the number of processors on the
computer. (Short form: /m[:n])
/toolsversion:<version>
The version of the MSBuild Toolset (tasks, targets, etc.)
to use during build. This version will override the
versions specified by individual projects. (Short form:
/tv)
Example:
/toolsversion:3.5
/verbosity:<level> Display this amount of information in the event log.
The available verbosity levels are: q[uiet], m[inimal],
n[ormal], d[etailed], and diag[nostic]. (Short form: /v)
Example:
/verbosity:quiet
/consoleloggerparameters:<parameters>
Parameters to console logger. (Short form: /clp)
The available parameters are:
PerformanceSummary--Show time spent in tasks, targets
and projects.
Summary--Show error and warning summary at the end.
NoSummary--Don't show error and warning summary at the
end.
ErrorsOnly--Show only errors.
WarningsOnly--Show only warnings.
NoItemAndPropertyList--Don't show list of items and
properties at the start of each project build.
ShowCommandLine--Show TaskCommandLineEvent messages
ShowTimestamp--Display the Timestamp as a prefix to any
message.
ShowEventId--Show eventId for started events, finished
events, and messages
ForceNoAlign--Does not align the text to the size of
the console buffer
DisableConsoleColor--Use the default console colors
for all logging messages.
DisableMPLogging-- Disable the multiprocessor
logging style of output when running in
non-multiprocessor mode.
EnableMPLogging--Enable the multiprocessor logging
style even when running in non-multiprocessor
mode. This logging style is on by default.
ForceConsoleColor--Use ANSI console colors even if
console does not support it
Verbosity--overrides the /verbosity setting for this
logger.
Example:
/consoleloggerparameters:PerformanceSummary;NoSummary;
Verbosity=minimal
/noconsolelogger Disable the default console logger and do not log events
to the console. (Short form: /noconlog)
/fileLogger[n] Logs the build output to a file. By default
the file is in the current directory and named
"msbuild[n].log". Events from all nodes are combined into
a single log. The location of the file and other
parameters for the fileLogger can be specified through
the addition of the "/fileLoggerParameters[n]" switch.
"n" if present can be a digit from 1-9, allowing up to
10 file loggers to be attached. (Short form: /fl[n])
/fileloggerparameters[n]:<parameters>
Provides any extra parameters for file loggers.
The presence of this switch implies the
corresponding /filelogger[n] switch.
"n" if present can be a digit from 1-9.
/fileloggerparameters is also used by any distributed
file logger, see description of /distributedFileLogger.
(Short form: /flp[n])
The same parameters listed for the console logger are
available. Some additional available parameters are:
LogFile--path to the log file into which the
build log will be written.
Append--determines if the build log will be appended
to or overwrite the log file. Setting the
switch appends the build log to the log file;
Not setting the switch overwrites the
contents of an existing log file.
The default is not to append to the log file.
Encoding--specifies the encoding for the file,
for example, UTF-8, Unicode, or ASCII
Default verbosity is Detailed.
Examples:
/fileLoggerParameters:LogFile=MyLog.log;Append;
Verbosity=diagnostic;Encoding=UTF-8
/flp:Summary;Verbosity=minimal;LogFile=msbuild.sum
/flp1:warningsonly;logfile=msbuild.wrn
/flp2:errorsonly;logfile=msbuild.err
/distributedlogger:<central logger>*<forwarding logger>
Use this logger to log events from MSBuild, attaching a
different logger instance to each node. To specify
multiple loggers, specify each logger separately.
(Short form /dl)
The <logger> syntax is:
[<logger class>,]<logger assembly>[;<logger parameters>]
The <logger class> syntax is:
[<partial or full namespace>.]<logger class name>
The <logger assembly> syntax is:
{<assembly name>[,<strong name>] | <assembly file>}
The <logger parameters> are optional, and are passed
to the logger exactly as you typed them. (Short form: /l)
Examples:
/dl:XMLLogger,MyLogger,Version=1.0.2,Culture=neutral
/dl:MyLogger,C:\My.dll*ForwardingLogger,C:\Logger.dll
/distributedFileLogger
Logs the build output to multiple log files, one log file
per MSBuild node. The initial location for these files is
the current directory. By default the files are called
"MSBuild<nodeid>.log". The location of the files and
other parameters for the fileLogger can be specified
with the addition of the "/fileLoggerParameters" switch.
If a log file name is set through the fileLoggerParameters
switch the distributed logger will use the fileName as a
template and append the node id to this fileName to
create a log file for each node.
/logger:<logger> Use this logger to log events from MSBuild. To specify
multiple loggers, specify each logger separately.
The <logger> syntax is:
[<logger class>,]<logger assembly>[;<logger parameters>]
The <logger class> syntax is:
[<partial or full namespace>.]<logger class name>
The <logger assembly> syntax is:
{<assembly name>[,<strong name>] | <assembly file>}
The <logger parameters> are optional, and are passed
to the logger exactly as you typed them. (Short form: /l)
Examples:
/logger:XMLLogger,MyLogger,Version=1.0.2,Culture=neutral
/logger:XMLLogger,C:\Loggers\MyLogger.dll;OutputAsHTML
/warnaserror[:code[;code2]]
List of warning codes to treats as errors. Use a semicolon
or a comma to separate multiple warning codes. To treat all
warnings as errors use the switch with no values.
(Short form: /err[:c;[c2]])
Example:
/warnaserror:MSB4130
When a warning is treated as an error the target will
continue to execute as if it was a warning but the overall
build will fail.
/warnasmessage[:code[;code2]]
List of warning codes to treats as low importance
messages. Use a semicolon or a comma to separate
multiple warning codes.
(Short form: /nowarn[:c;[c2]])
Example:
/warnasmessage:MSB3026
/ignoreprojectextensions:<extensions>
List of extensions to ignore when determining which
project file to build. Use a semicolon or a comma
to separate multiple extensions.
(Short form: /ignore)
Example:
/ignoreprojectextensions:.sln
/preprocess[:file]
Creates a single, aggregated project file by
inlining all the files that would be imported during a
build, with their boundaries marked. This can be
useful for figuring out what files are being imported
and from where, and what they will contribute to
the build. By default the output is written to
the console window. If the path to an output file
is provided that will be used instead.
(Short form: /pp)
Example:
/pp:out.txt
/detailedsummary
Shows detailed information at the end of the build
about the configurations built and how they were
scheduled to nodes.
(Short form: /ds)
@<file> Insert command-line settings from a text file. To specify
multiple response files, specify each response file
separately.
Any response files named "msbuild.rsp" are automatically
consumed from the following locations:
(1) the directory of msbuild.exe
(2) the directory of the first project or solution built
/noautoresponse Do not auto-include any MSBuild.rsp files. (Short form:
/noautorsp)
/nologo Do not display the startup banner and copyright message.
/version Display version information only. (Short form: /ver)
/help Display this usage message. (Short form: /? or /h)
Examples:
MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release
MSBuild MyApp.csproj /t:Clean
/p:Configuration=Debug;TargetFrameworkVersion=v3.5
Usage: dotnet new [arguments] [options]
Arguments:
template The template to instantiate.
Options:
-l|--list List templates containing the specified name.
-lang|--language Specifies the language of the template to create
-n|--name The name for the output being created. If no name is specified, the name of the current directory is used.
-o|--output Location to place the generated output.
-h|--help Displays help for this command.
-all|--show-all Shows all templates
Templates Short Name Language Tags
----------------------------------------------------------------------
Console Application console [C#], F# Common/Console
Class library classlib [C#], F# Common/Library
Unit Test Project mstest [C#], F# Test/MSTest
xUnit Test Project xunit [C#], F# Test/xUnit
ASP.NET Core Empty web [C#] Web/Empty
ASP.NET Core Web App mvc [C#], F# Web/MVC
ASP.NET Core Web API webapi [C#] Web/WebAPI
Solution File sln Solution
Examples:
dotnet new mvc --auth None --framework netcoreapp1.1
dotnet new classlib
dotnet new --help
Usage: dotnet nuget [options] [command]
Options:
-h|--help Show help information
--version Show version information
-v|--verbosity <verbosity> The verbosity of logging to use. Allowed values: Debug, Verbose, Information, Minimal, Warning, Error.
Commands:
delete Deletes a package from the server.
locals Clears or lists local NuGet resources such as http requests cache, packages cache or machine-wide global packages folder.
push Pushes a package to the server and publishes it.
Use "dotnet nuget [command] --help" for more information about a command.
Usage: pack [arguments] [options] [args]
Arguments:
<PROJECT> The project to pack, defaults to the project file in the current directory. Can be a path to any project file
Options:
-h|--help Show help information
-o|--output <OUTPUT_DIR> Directory in which to place built packages.
--no-build Skip building the project prior to packing. By default, the project will be built.
--include-symbols Include packages with symbols in addition to regular packages in output directory.
--include-source Include PDBs and source files. Source files go into the src folder in the resulting nuget package
-c|--configuration <CONFIGURATION> Configuration to use for building the project. Default for most projects is "Debug".
--version-suffix <VERSION_SUFFIX> Defines the value for the $(VersionSuffix) property in the project.
-s|--serviceable Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing.
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Additional Arguments:
Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options.
Usage: dotnet publish [arguments] [options] [args]
Arguments:
<PROJECT> The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file.
Options:
-h|--help Show help information
-f|--framework <FRAMEWORK> Target framework to publish for. The target framework has to be specified in the project file.
-r|--runtime <RUNTIME_IDENTIFIER> Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app.
-o|--output <OUTPUT_DIR> Output directory in which to place the published artifacts.
-c|--configuration <CONFIGURATION> Configuration to use for building the project. Default for most projects is "Debug".
--version-suffix <VERSION_SUFFIX> Defines the value for the $(VersionSuffix) property in the project.
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Additional Arguments:
Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options.
Usage: dotnet remove [arguments] [options] [command]
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
Options:
-h|--help Show help information
Commands:
package Command to remove package reference.
reference Command to remove project to project reference
Use "dotnet remove [command] --help" for more information about a command.
Usage: restore [arguments] [options] [args]
Arguments:
[PROJECT] Optional path to a project file or MSBuild arguments.
Options:
-h|--help Show help information
-s|--source <SOURCE> Specifies a NuGet package source to use during the restore.
-r|--runtime <RUNTIME_IDENTIFIER> Target runtime to restore packages for.
--packages <PACKAGES_DIRECTORY> Directory to install packages in.
--disable-parallel Disables restoring multiple projects in parallel.
--configfile <FILE> The NuGet configuration file to use.
--no-cache Do not cache packages and http requests.
--ignore-failed-sources Treat package source failures as warnings.
--no-dependencies Set this flag to ignore project to project references and only restore the root project
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Additional Arguments:
Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options.
Usage: dotnet run [options] [[--] <additional arguments>...]]
Options:
-h|--help Show help information
-c|--configuration Configuration to use for building the project. Default for most projects is "Debug".
-f|--framework <FRAMEWORK> Build and run the app using the specified framework. The framework has to be specified in the project file.
-p|--project The path to the project file to run (defaults to the current directory if there is only one project).
Additional Arguments:
Arguments passed to the application that is being run.
Usage: dotnet sln [arguments] [options] [command]
Arguments:
<SLN_FILE> Solution file to operate on. If not specified, the command will search the current directory for one.
Options:
-h|--help Show help information
Commands:
add Add a specified project(s) to the solution.
list List all projects in the solution.
remove Remove the specified project(s) from the solution. The project is not impacted.
Use "dotnet sln [command] --help" for more information about a command.
Arguments:
<PROJECT> The project to test, defaults to the current directory.
Options:
-h|--help Show help information
-s|--settings <SETTINGS_FILE> Settings to use when running tests.
-t|--list-tests Lists discovered tests
--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.MethodName"
Run tests that contain the specified name: --filter "FullyQualifiedName~Namespace.Class"
More info on filtering support: https://aka.ms/vstest-filtering
-a|--test-adapter-path Use custom adapters from the given path in the test run.
Example: --test-adapter-path <PATH_TO_ADAPTER>
-l|--logger <LoggerUri/FriendlyName> Specify a logger for test results.
Example: --logger "trx[;LogFileName=<Defaults to unique file name>]"
-c|--configuration <CONFIGURATION> Configuration to use for building the project. Default for most projects is "Debug".
-f|--framework <FRAMEWORK> Looks for test binaries for a specific framework
-o|--output <OUTPUT_DIR> Directory in which to find the binaries to be run
-d|--diag <PATH_TO_FILE> Enable verbose logs for test platform.
Logs are written to the provided file.
--no-build Do not build project before testing.
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Additional Arguments:
Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options.
Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
Usage: vstest.console.exe [Arguments] [Options] [[--] <args>...]]
Description: Runs tests from the specified files.
Arguments:
[TestFileNames]
Run tests from the specified files. Separate multiple test file names
by spaces.
Examples: mytestproject.dll
mytestproject.dll myothertestproject.exe
Options:
--Settings|/Settings:<Settings File>
Settings to use when running tests.
--Tests|/Tests:<Test Names>
Run tests with names that match the provided values. To provide multiple
values, separate them by commas.
Examples: /Tests:TestMethod1
/Tests:TestMethod1,testMethod2
--TestAdapterPath|/TestAdapterPath
This makes vstest.console.exe process use custom test adapters
from a given path (if any) in the test run.
Example /TestAdapterPath:<pathToCustomAdapters>
--Platform|/Platform:<Platform type>
Target platform architecture to be used for test execution.
Valid values are x86, x64 and ARM.
--Framework|/Framework:<Framework Version>
Target .Net Framework version to be used for test execution.
Valid values are ".NETFramework,Version=v4.6", ".NETCoreApp,Version=v1.0" etc.
Other supported values are Framework35, Framework40, Framework45 and FrameworkCore10.
--Parallel|/Parallel
Specifies that the tests be executed in parallel. By default up
to all available cores on the machine may be used.
The number of cores to use may be configured using a settings file.
--TestCaseFilter|/TestCaseFilter:<Expression>
Run tests that match the given expression.
<Expression> is of the format <property>Operator<value>[|&<Expression>]
where Operator is one of =, != or ~ (Operator ~ has 'contains'
semantics and is applicable for string properties like DisplayName).
Parenthesis () can be used to group sub-expressions.
Examples: /TestCaseFilter:"Priority=1"
/TestCaseFilter:"(FullyQualifiedName~Nightly
|Name=MyTestMethod)"
-?|--Help|/?|/Help
Display this usage message.
--logger|/logger:<Logger Uri/FriendlyName>
Specify a logger for test results. For example, to log results into a
Visual Studio Test Results File (TRX) use /logger:trx [;LogFileName=<Defaults to unique file name>]
Creates file in TestResults directory with given LogFileName.
To publish test results to Team Foundation Server, use TfsPublisher as shown below
Example: /logger:TfsPublisher;
Collection=<team project collection url>;
BuildName=<build name>;
TeamProject=<team project name>
[;Platform=<Defaults to "Any CPU">]
[;Flavor=<Defaults to "Debug">]
[;RunTitle=<title>]
-lt|--ListTests|/lt|/ListTests:<File Name>
Lists discovered tests from the given test container.
--ParentProcessId|/ParentProcessId:<ParentProcessId>
Process Id of the Parent Process responsible for launching current process.
--Port|/Port:<Port>
The Port for socket connection and receiving the event messages.
--Diag|/Diag:<Path to log file>
Enable verbose logs for test platform.
Logs are written to the provided file.
Args:
Any extra arguments that should be passed to adapter. Arguments may be specified as name-value pair of the form <n>=<v>, where <n> is the argument name, and <v> is the argument value. Use a space to separate multiple arguments.
To run tests in the same process:
>vstest.console.exe tests.dll
To run tests in a separate process:
>vstest.console.exe /inIsolation tests.dll
To run tests with additional settings such as data collectors:
>vstest.console.exe tests.dll /Settings:Local.RunSettings
Usage: dotnet [host-options] [command] [arguments] [common-options]
Arguments:
[command] The command to execute
[arguments] Arguments to pass to the command
[host-options] Options specific to dotnet (host)
[common-options] Options common to all commands
Common options:
-v|--verbose Enable verbose output
-h|--help Show help
Host options (passed before the command):
-d|--diagnostics Enable diagnostic output
--version Display .NET CLI Version Number
--info Display .NET CLI Info
Commands:
new Initialize .NET projects.
restore Restore dependencies specified in the .NET project.
build Builds a .NET project.
publish Publishes a .NET project for deployment (including the runtime).
run Compiles and immediately executes a .NET project.
test Runs unit tests using the test runner specified in the project.
pack Creates a NuGet package.
migrate Migrates a project.json based project to a msbuild based project.
clean Clean build output(s).
sln Modify solution (SLN) files.
Project modification commands:
add Add items to the project
remove Remove items from the project
list List items in the project
Advanced Commands:
nuget Provides additional NuGet commands.
msbuild Runs Microsoft Build Engine (MSBuild).
vstest Runs Microsoft Test Execution Command Line Tool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment