The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
dotnetBuild
: .NET: Build project (build)dotnetClean
: .NET: Clean project output (clean)dotnetNuGetDelete
: .NET: Delete/Unlist NuGet package (nuget delete)dotnetListPackage
: .NET: Show dependencies (list package)dotnetNuGetLocals
: .NET: Clear/List NuGet cache locations (nuget locals)dotnetPack
: .NET: Create NuGet package (pack)dotnetPublish
: .NET: Publish project (publish)dotnetNuGetPush
: .NET: Publish NuGet package (nuget push)dotnetTest
: .NET: Run unit tests (test)dotnetRestore
: .NET: Restore project dependencies (restore)dotnetToolRestore
: .NET: Restore local tools (tool restore)withDotNet
: With .NETdotnetBuild
: .NET: Build project (build)dotnet build
command builds the project and its dependencies into a set of binaries. The binaries include the project's code in Intermediate Language (IL) files with a .dll extension. Depending on the project type and settings, other files may be included, such as:
configuration
(optional)
Debug
, but you can override the build configuration settings in your project.
String
force
(optional)
boolean
framework
(optional)
String
noDependencies
(optional)
boolean
noIncremental
(optional)
boolean
noRestore
(optional)
boolean
nologo
(optional)
boolean
option
(optional)
String
options
(optional)
String
optionsString
(optional)
String
outputDirectory
(optional)
./bin/<configuration>/<framework>/
. For projects with multiple target frameworks (via the TargetFrameworks
property), you also need to specify a specific framework when you specify this option.
String
project
(optional)
String
properties
(optional)
java.util.Map<java.lang.String, java.lang.String>
propertiesString
(optional)
String
runtime
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
shutDownBuildServers
(optional)
dotnet build-server shutdown
will be executed after the main command, shutting down build servers that may have been started.
hanguntil those server processes end. As such, it's recommended to specify this for the last .NET-related step in a job. If using multiple SDKs, each needs its own shutdown (e.g. the .NET Core 3.1 SDK will not shut down build servers from the .NET 5.0 SDK).
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
target
(optional)
String
targets
(optional)
String
targetsString
(optional)
String
unstableIfWarnings
(optional)
boolean
verbosity
(optional)
String
versionSuffix
(optional)
$(VersionSuffix)
property to use when building the project. This only works if the $(Version)
property isn't set. Then, $(Version)
is set to the $(VersionPrefix)
combined with the $(VersionSuffix)
, separated by a dash.
String
workDirectory
(optional)
String
dotnetClean
: .NET: Clean project output (clean)dotnet clean
command cleans the output of the previous build. It's implemented as an MSBuild target, so the project is evaluated when the command is run. Only the outputs created during the build are cleaned. Both intermediate (obj) and final output (bin) folders are cleaned.
configuration
(optional)
Debug
, but you can override the build configuration settings in your project. This option is only required when cleaning if you specified it during build time.
String
framework
(optional)
String
nologo
(optional)
boolean
option
(optional)
String
options
(optional)
String
optionsString
(optional)
String
outputDirectory
(optional)
String
project
(optional)
String
properties
(optional)
java.util.Map<java.lang.String, java.lang.String>
propertiesString
(optional)
String
runtime
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
shutDownBuildServers
(optional)
dotnet build-server shutdown
will be executed after the main command, shutting down build servers that may have been started.
hanguntil those server processes end. As such, it's recommended to specify this for the last .NET-related step in a job. If using multiple SDKs, each needs its own shutdown (e.g. the .NET Core 3.1 SDK will not shut down build servers from the .NET 5.0 SDK).
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
unstableIfWarnings
(optional)
boolean
verbosity
(optional)
String
workDirectory
(optional)
String
dotnetNuGetDelete
: .NET: Delete/Unlist NuGet package (nuget delete)dotnet nuget delete
command deletes or unlists a package from the server. For nuget.org, the action is to unlist the package.
apiKeyId
(optional)
String
forceEnglishOutput
(optional)
boolean
noServiceEndpoint
(optional)
boolean
packageName
(optional)
String
packageVersion
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
source
(optional)
https://www.nuget.org
, https://www.nuget.org/api/v3
, and https://www.nuget.org/api/v2/package
. For private feeds, replace the host name (for example, %hostname%/api/v3
).
String
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
workDirectory
(optional)
String
dotnetListPackage
: .NET: Show dependencies (list package)dotnet list package
command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process.
config
(optional)
String
deprecated
(optional)
boolean
framework
(optional)
String
frameworks
(optional)
String
frameworksString
(optional)
String
highestMinor
(optional)
boolean
highestPatch
(optional)
boolean
includePrerelease
(optional)
boolean
includeTransitive
(optional)
boolean
outdated
(optional)
boolean
project
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
source
(optional)
String
sources
(optional)
String
sourcesString
(optional)
String
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
verbosity
(optional)
String
workDirectory
(optional)
String
dotnetNuGetLocals
: .NET: Clear/List NuGet cache locations (nuget locals)dotnet nuget locals
command clears or lists local NuGet resources in the http-request cache, temporary cache, or machine-wide global packages folder.
cacheLocation
(optional)
all
: Indicates that the specified operation is applied to all cache types: http-request cache, global packages cache, and the temporary cache. global-packages
: Indicates that the specified operation is applied only to the global packages cache. The other cache locations aren't affected. http-cache
: Indicates that the specified operation is applied only to the http-request cache. The other cache locations aren't affected. temp
: Indicates that the specified operation is applied only to the temporary cache. The other cache locations aren't affected. String
forceEnglishOutput
(optional)
boolean
operation
(optional)
clear
: The contents of the cache directories are deleted recursively. The executing user/group must have permission to the files in the cache directories. If not, an error is displayed indicating the files/folders that weren't cleared. list
: Displays the path to the specified cache location.String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
workDirectory
(optional)
String
dotnetPack
: .NET: Create NuGet package (pack)dotnet pack
command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a .nupkg file).
configuration
(optional)
Debug
, but you can override the build configuration settings in your project.
String
force
(optional)
boolean
includeSource
(optional)
src
folder within the symbols package.
boolean
includeSymbols
(optional)
boolean
noBuild
(optional)
boolean
noDependencies
(optional)
boolean
noRestore
(optional)
boolean
nologo
(optional)
boolean
option
(optional)
String
options
(optional)
String
optionsString
(optional)
String
outputDirectory
(optional)
String
project
(optional)
String
properties
(optional)
java.util.Map<java.lang.String, java.lang.String>
propertiesString
(optional)
String
runtime
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
shutDownBuildServers
(optional)
dotnet build-server shutdown
will be executed after the main command, shutting down build servers that may have been started.
hanguntil those server processes end. As such, it's recommended to specify this for the last .NET-related step in a job. If using multiple SDKs, each needs its own shutdown (e.g. the .NET Core 3.1 SDK will not shut down build servers from the .NET 5.0 SDK).
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
unstableIfWarnings
(optional)
boolean
verbosity
(optional)
String
versionSuffix
(optional)
$(VersionSuffix)
MSBuild property in the project.
String
workDirectory
(optional)
String
dotnetPublish
: .NET: Publish project (publish)dotnet publish
compiles the application, reads through its dependencies specified in the project file, and publishes the resulting set of files to a directory. The output includes the following assets:
dotnet publish
command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution. It's the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET Core shared runtime installed on it. For more information, see Publish .NET Core apps with the .NET Core CLI .
configuration
(optional)
Debug
, but you can override the build configuration settings in your project.
String
force
(optional)
boolean
framework
(optional)
String
manifest
(optional)
String
manifests
(optional)
String
manifestsString
(optional)
dotnet store command
.
String
noBuild
(optional)
boolean
noDependencies
(optional)
boolean
noRestore
(optional)
boolean
nologo
(optional)
boolean
option
(optional)
String
options
(optional)
String
optionsString
(optional)
String
outputDirectory
(optional)
dotnet publish
commands result in nested output folders. For example, if the project folder is myproject, and the publish output folder is myproject/publish, and you run dotnet publish
twice, the second run puts content files such as .config and .json files in myproject/publish/publish. To avoid nesting publish folders, specify a publish folder that is not directly under the project folder, or exclude the publish folder from the project.
PublishDir
property instead of this option. String
project
(optional)
String
properties
(optional)
java.util.Map<java.lang.String, java.lang.String>
propertiesString
(optional)
dotnet publish
:
PublishProfile=Properties\PublishProfiles\profile.pubxml
: Use a .pubxml to set publish-related properties. See Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment for more information. PublishReadyToRun=true
: Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images.PublishSingleFile=true
: Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used.PublishTrimmed=true
: Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables .PublishProfile
, in a publish profile rather than here.
String
runtime
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
selfContained
(optional)
boolean
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
shutDownBuildServers
(optional)
dotnet build-server shutdown
will be executed after the main command, shutting down build servers that may have been started.
hanguntil those server processes end. As such, it's recommended to specify this for the last .NET-related step in a job. If using multiple SDKs, each needs its own shutdown (e.g. the .NET Core 3.1 SDK will not shut down build servers from the .NET 5.0 SDK).
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
unstableIfWarnings
(optional)
boolean
verbosity
(optional)
String
versionSuffix
(optional)
*
) in the version field of the project file.
String
workDirectory
(optional)
String
dotnetNuGetPush
: .NET: Publish NuGet package (nuget push)dotnet nuget push
command pushes a package to the server and publishes it. The push command uses server and credential details found in the system's NuGet config file or chain of config files. For more information on config files, see Configuring NuGet Behavior. NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config (Windows) or $HOME/.local/share (Linux/macOS), then loading any nuget.config or .nuget\nuget.config starting from the root of drive and ending in the current directory.
dotnet pack
.
apiKeyId
(optional)
String
disableBuffering
(optional)
boolean
forceEnglishOutput
(optional)
boolean
noServiceEndpoint
(optional)
boolean
noSymbols
(optional)
boolean
root
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
skipDuplicate
(optional)
boolean
source
(optional)
https://www.nuget.org
, https://www.nuget.org/api/v3
, and https://www.nuget.org/api/v2/package
. For private feeds, replace the host name (for example, %hostname%/api/v3
).
DefaultPushSource
config value is set in the NuGet config file.
String
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
symbolApiKeyId
(optional)
String
symbolSource
(optional)
String
timeout
(optional)
int
workDirectory
(optional)
String
dotnetTest
: .NET: Run unit tests (test)dotnet test
command is used to execute unit tests in a given solution. It builds the solution and runs a test host application for each test project in the solution. The test host executes tests in the given project using a test framework, for example: MSTest, NUnit, or xUnit, and reports the success or failure of each test. If all tests are successful, the test runner returns 0 as an exit code; otherwise if any test fails, it returns 1.
blame
(optional)
TestResults/<Guid>/<Guid>_Sequence.xml
that captures the order of tests that were run before the crash.
boolean
blameCrash
(optional)
--blame
.
VSTEST_DUMP_FORCEPROCDUMP
environment variable to 1
.
boolean
blameCrashCollectAlways
(optional)
boolean
blameCrashDumpType
(optional)
--blame-crash
.
String
blameHang
(optional)
boolean
blameHangDumpType
(optional)
full
, mini
, or none
. When none
is specified, the test host is terminated on timeout, but no dump is collected. Implies --blame-hang
.
String
blameHangTimeout
(optional)
--blame
and --blame-hang
.
int
collect
(optional)
String
configuration
(optional)
Debug
, but you can override the build configuration settings in your project.
String
diag
(optional)
*.host_<date>.txt
for the test host log, and *.datacollector_<date>.txt
for the data collector log.
String
filter
(optional)
String
framework
(optional)
dotnet
or a .NET Framework test host for the test binaries. This option only determines which type of host to use. The actual framework version to be used is determined by the runtimeconfig.json of the test project. When not specified, the TargetFramework assembly attribute is used to determine the type of host. When that attribute is stripped from the .dll, the .NET Framework host is used.
String
listTests
(optional)
boolean
logger
(optional)
dotnet test
doesn't accept abbreviations: instead of "console;v=d
", use "console;verbosity=detailed
".
String
noBuild
(optional)
boolean
noRestore
(optional)
boolean
nologo
(optional)
boolean
option
(optional)
String
options
(optional)
String
optionsString
(optional)
String
outputDirectory
(optional)
./bin/<configuration>/<framework>/
. For projects with multiple target frameworks (via the TargetFrameworks
property), you also need to specify a framework when you specify this option. dotnet test
always runs tests from the output directory. You can use AppDomain.BaseDirectory to consume test assets in the output directory.
String
project
(optional)
String
properties
(optional)
java.util.Map<java.lang.String, java.lang.String>
propertiesString
(optional)
String
resultsDirectory
(optional)
TestResults
in the directory that contains the project file.
String
runSettings
(optional)
java.util.Map<java.lang.String, java.lang.String>
runSettingsString
(optional)
RunSettings
values, specified in in Java properties syntax.
String
runtime
(optional)
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
settings
(optional)
.runsettings
file to use for running the tests. Note that the TargetPlatform
element (x86|x64) has no effect for dotnet test
. To run tests that target x86, install the x86 version of .NET Core. The bitness of the dotnet.exe that is on the path is what will be used for running tests.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
shutDownBuildServers
(optional)
dotnet build-server shutdown
will be executed after the main command, shutting down build servers that may have been started.
hanguntil those server processes end. As such, it's recommended to specify this for the last .NET-related step in a job. If using multiple SDKs, each needs its own shutdown (e.g. the .NET Core 3.1 SDK will not shut down build servers from the .NET 5.0 SDK).
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
testAdapterPath
(optional)
.TestAdapter.dll
are inspected. If not specified, the directory of the test .dll is searched.
String
unstableIfWarnings
(optional)
boolean
verbosity
(optional)
String
workDirectory
(optional)
String
dotnetRestore
: .NET: Restore project dependencies (restore)dotnet restore
command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. In most cases, you don't need to explicitly use the dotnet restore
command, since a NuGet restore is run implicitly if necessary when you run the following commands:
dotnet restore
explicitly to control when the restore occurs so that they can control network usage. To prevent the implicit NuGet restore, you can use the --no-restore
flag with any of these commands to disable implicit restore.
configfile
(optional)
String
disableParallel
(optional)
boolean
force
(optional)
boolean
forceEvaluate
(optional)
boolean
ignoreFailedSources
(optional)
boolean
lockFilePath
(optional)
String
lockedMode
(optional)
boolean
noCache
(optional)
boolean
noDependencies
(optional)
boolean
packages
(optional)
String
project
(optional)
String
runtime
(optional)
String
runtimes
(optional)
String
runtimesString
(optional)
<RuntimeIdentifiers>
tag in the .csproj file. For a list of Runtime Identifiers (RIDs), see the RID catalog.
String
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
source
(optional)
String
sources
(optional)
String
sourcesString
(optional)
String
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
useLockFile
(optional)
boolean
verbosity
(optional)
String
workDirectory
(optional)
String
dotnetToolRestore
: .NET: Restore local tools (tool restore)dotnet tool restore
command finds the tool manifest file that is in scope for the current directory and installs the tools that are listed in it. For information about manifest files, see Install a local tool and Invoke a local tool.
additionalSource
(optional)
String
additionalSources
(optional)
String
additionalSourcesString
(optional)
String
configfile
(optional)
String
disableParallel
(optional)
boolean
ignoreFailedSources
(optional)
boolean
noCache
(optional)
boolean
sdk
(optional)
dotnet
will be in the path.
With .NETelement (or a
withDotNet
block in a pipeline script) to specify one, or ensure this step runs on a node that has a .NET SDK installed and in the path.
String
showSdkInfo
(optional)
dotnet --info
will be executed before the main command. This shows a list of available SDKs and runtimes, indicating which one is currently being used.
boolean
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
toolManifest
(optional)
String
verbosity
(optional)
q[uiet]
, m[inimal]
, n[ormal]
, d[etailed]
, and diag[nostic]
.
String
workDirectory
(optional)
String
withDotNet
: With .NETdotnet
utility.
sdk
(optional)
dotnet
will be in the path.
String
specificSdkVersion
(optional)
dotnet
executable may use the most recent SDK available on the system, even when PATH
is set up to find an older SDK deployment first; see this page for more information.
global.json
file will be created in the current directory, referencing that SDK version and disabling roll-forward.
global.json
already present in the current directory.
boolean
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.