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.

.NET SDK Support

dotnetBuild: .NET: Build project (build)

The 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:
  1. An executable that can be used to run the application, if the project type is an executable targeting .NET Core 3.0 or later.
  2. Symbol files used for debugging, with a .pdb extension.
  3. A .deps.json file, which lists the dependencies of the application or library.
  4. A .runtimeconfig.json file, which specifies the shared runtime and its version for an application.
  5. Other libraries that the project depends on (via project references or NuGet package references).
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • configuration (optional)
    Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
    • Type: String
  • force (optional)
    Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file.
    • Type: boolean
  • framework (optional)
    Compiles for a specific framework. The framework must be defined in the project file.
    • Type: String
  • noDependencies (optional)
    Ignores project-to-project references and only restores the root project.
    • Type: boolean
  • noIncremental (optional)
    Marks the build as unsafe for incremental build. This flag turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
    • Type: boolean
  • noRestore (optional)
    Doesn't execute an implicit restore when running the command.
    • Type: boolean
  • nologo (optional)
    Doesn't display the startup banner or the copyright message.

    Available since: .NET Core SDK 3.0
    • Type: boolean
  • option (optional)
    • Type: String
  • options (optional)
    • Type: Array / List of String
  • optionsString (optional)
    For more information about these options, see the MSBuild Command-Line Reference.
    If targets and/or properties are also configured, those will be passed after these options.
    • Type: String
  • outputDirectory (optional)
    Directory in which to place the built binaries. If not specified, the default path is ./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.
    • Type: String
  • project (optional)
    The MSBuild project or solution to build. If a directory is specified, MSBuild searches it for a (single) file that has a file extension that ends in proj or sln, and uses that file. If nothing is specified, the current working directory is searched in the same way.
    • Type: String
  • properties (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • propertiesString (optional)
    Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
    • Type: String
  • runtime (optional)
    Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the RID catalog.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • shutDownBuildServers (optional)
    If enabled, dotnet build-server shutdown will be executed after the main command, shutting down build servers that may have been started.
    Note: If this is not specified, a build that causes such a build server to be started may hang until 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).

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • target (optional)
    • Type: String
  • targets (optional)
    • Type: Array / List of String
  • targetsString (optional)
    Specifies the MSBuild targets to build. If none are specified, the default target specified in the project will be built.
    • Type: String
  • unstableIfErrors (optional)
    If this is set and the build completes with errors, the build will be marked as unstable instead of failed.
    • Type: boolean
  • unstableIfWarnings (optional)
    If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
    • Type: boolean
  • verbosity (optional)
    Sets the MSBuild verbosity level.
    • Type: String
  • versionSuffix (optional)
    Sets the value of the $(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.
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetClean: .NET: Clean project output (clean)

The 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.
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • configuration (optional)
    Defines the build configuration. The default for most projects is 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.
    • Type: String
  • framework (optional)
    The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning.
    • Type: String
  • nologo (optional)
    Doesn't display the startup banner or the copyright message.

    Available since: .NET Core SDK 3.0
    • Type: boolean
  • option (optional)
    • Type: String
  • options (optional)
    • Type: Array / List of String
  • optionsString (optional)
    For more information about these options, see the MSBuild Command-Line Reference.
    If targets and/or properties are also configured, those will be passed after these options.
    • Type: String
  • outputDirectory (optional)
    The directory that contains the build artifacts to clean. If you specified the framework when the project was built, that same framework should also be specified for this cleanup action.
    • Type: String
  • project (optional)
    The MSBuild project or solution to clean. If a directory is specified, MSBuild searches it for a (single) file that has a file extension that ends in proj or sln, and uses that file. If nothing is specified, the current working directory is searched in the same way.
    • Type: String
  • properties (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • propertiesString (optional)
    Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
    • Type: String
  • runtime (optional)
    Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • shutDownBuildServers (optional)
    If enabled, dotnet build-server shutdown will be executed after the main command, shutting down build servers that may have been started.
    Note: If this is not specified, a build that causes such a build server to be started may hang until 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).

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • unstableIfErrors (optional)
    If this is set and the build completes with errors, the build will be marked as unstable instead of failed.
    • Type: boolean
  • unstableIfWarnings (optional)
    If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
    • Type: boolean
  • verbosity (optional)
    Sets the MSBuild verbosity level.
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetNuGetDelete: .NET: Delete/Unlist NuGet package (nuget delete)

The dotnet nuget delete command deletes or unlists a package from the server. For nuget.org, the action is to unlist the package.
  • apiKeyId (optional)
    The API key for the server.
    • Type: String
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • forceEnglishOutput (optional)
    Forces the application to run using an invariant, English-based culture.
    • Type: boolean
  • noServiceEndpoint (optional)
    Doesn't append "api/v2/package" to the source URL.

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • packageName (optional)
    Name/ID of the package to delete.
    • Type: String
  • packageVersion (optional)
    Version of the package to delete.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • source (optional)
    Specifies the server URL. Supported URLs for nuget.org include 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).
    • Type: String
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetListPackage: .NET: Show dependencies (list package)

The 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.
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • config (optional)
    Configuration file containing the NuGet sources to use when searching for newer packages. Requires the --outdated, --deprecated or --vulnerable option.
    • Type: String
  • deprecated (optional)
    Lists packages that have been deprecated. Cannot be combined with --vulnerable or --outdated options.

    Available since: .NET Core SDK 3.1.300
    • Type: boolean
  • framework (optional)
    • Type: String
  • frameworks (optional)
    • Type: Array / List of String
  • frameworksString (optional)
    Displays only the packages applicable for the specified target frameworks.
    • Type: String
  • highestMinor (optional)
    Considers only the packages with a matching major version number when searching for newer packages. Requires the --outdated option.
    • Type: boolean
  • highestPatch (optional)
    Considers only the packages with a matching major and minor version numbers when searching for newer packages. Requires the --outdated option.
    • Type: boolean
  • includePrerelease (optional)
    Considers packages with prerelease versions when searching for newer packages. Requires the --outdated option.
    • Type: boolean
  • includeTransitive (optional)
    Lists transitive packages, in addition to the top-level packages. When specifying this option, you get a list of packages that the top-level packages depend on.
    • Type: boolean
  • outdated (optional)
    Lists packages that have newer versions. Cannot be combined with --deprecated or --vulnerable options.
    • Type: boolean
  • project (optional)
    The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • source (optional)
    • Type: String
  • sources (optional)
    • Type: Array / List of String
  • sourcesString (optional)
    The NuGet sources to use when searching for packages. Requires the --outdated>, --deprecated> or --vulnerable> option.
    • Type: String
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • verbosity (optional)
    Sets the verbosity level of the command.

    Note that this option only has an effect since the .NET 5 SDK.
    • Type: String
  • vulnerable (optional)
    Lists packages that have known vulnerabilities. Cannot be combined with --deprecated or --outdated options.
    Available since: .NET Core SDK 5.0.200
    • Type: boolean
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetNuGetLocals: .NET: Clear/List NuGet cache locations (nuget locals)

The 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)
    The cache location to list or clear. It accepts one of the following values:
    • 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.
    • Type: String
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • forceEnglishOutput (optional)
    Forces the application to run using an invariant, English-based culture.
    • Type: boolean
  • operation (optional)
    Two operations are supported:
    • 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.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetPack: .NET: Create NuGet package (pack)

The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a .nupkg file).
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • configuration (optional)
    Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
    • Type: String
  • force (optional)
    Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file.
    • Type: boolean
  • includeSource (optional)
    Includes the debug symbols NuGet packages in addition to the regular NuGet packages in the output directory. The sources files are included in the src folder within the symbols package.
    • Type: boolean
  • includeSymbols (optional)
    Includes the debug symbols NuGet packages in addition to the regular NuGet packages in the output directory.
    • Type: boolean
  • noBuild (optional)
    Doesn't build the project before packing, and does not perform an implicit restore.
    • Type: boolean
  • noDependencies (optional)
    Ignores project-to-project references and only restores the root project.
    • Type: boolean
  • noRestore (optional)
    Doesn't execute an implicit restore when running the command.
    • Type: boolean
  • nologo (optional)
    Doesn't display the startup banner or the copyright message.

    Available since: .NET Core SDK 3.0
    • Type: boolean
  • option (optional)
    • Type: String
  • options (optional)
    • Type: Array / List of String
  • optionsString (optional)
    For more information about these options, see the MSBuild Command-Line Reference.
    If targets and/or properties are also configured, those will be passed after these options.
    • Type: String
  • outputDirectory (optional)
    Places the built packages in the directory specified.
    • Type: String
  • project (optional)
    The project or solution to pack. It's either a path to a csproj file, vbproj file, fsproj file, a solution file, or to a directory. If not specified, the command searches the current directory for a project or solution file.
    • Type: String
  • properties (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • propertiesString (optional)
    Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
    • Type: String
  • runtime (optional)
    Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the RID catalog.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • shutDownBuildServers (optional)
    If enabled, dotnet build-server shutdown will be executed after the main command, shutting down build servers that may have been started.
    Note: If this is not specified, a build that causes such a build server to be started may hang until 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).

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • unstableIfErrors (optional)
    If this is set and the build completes with errors, the build will be marked as unstable instead of failed.
    • Type: boolean
  • unstableIfWarnings (optional)
    If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
    • Type: boolean
  • verbosity (optional)
    Sets the MSBuild verbosity level.
    • Type: String
  • versionSuffix (optional)
    Defines the value for the $(VersionSuffix) MSBuild property in the project.
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: 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:
  • Intermediate Language (IL) code in an assembly with a dll extension.
  • A .deps.json file that includes all of the dependencies of the project.
  • A .runtimeconfig.json file that specifies the shared runtime that the application expects, as well as other configuration options for the runtime (for example, garbage collection type).
  • The application's dependencies, which are copied from the NuGet cache into the output folder.
The 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 .
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • configuration (optional)
    Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
    • Type: String
  • force (optional)
    Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file.
    • Type: boolean
  • framework (optional)
    Publishes the application for the specified target framework. You must specify the target framework in the project file.
    • Type: String
  • manifest (optional)
    • Type: String
  • manifests (optional)
    • Type: Array / List of String
  • manifestsString (optional)
    Specifies one or several target manifests to use to trim the set of packages published with the app. The manifest file is part of the output of the dotnet store command.
    • Type: String
  • noBuild (optional)
    Doesn't build the project before publishing, and does not perform an implicit restore.
    • Type: boolean
  • noDependencies (optional)
    Ignores project-to-project references and only restores the root project.
    • Type: boolean
  • noRestore (optional)
    Doesn't execute an implicit restore when running the command.
    • Type: boolean
  • nologo (optional)
    Doesn't display the startup banner or the copyright message.

    Available since: .NET Core SDK 3.0
    • Type: boolean
  • option (optional)
    • Type: String
  • options (optional)
    • Type: Array / List of String
  • optionsString (optional)
    For more information about these options, see the MSBuild Command-Line Reference.
    If targets and/or properties are also configured, those will be passed after these options.
    • Type: String
  • outputDirectory (optional)
    Specifies the path for the output directory.
    If not specified, it defaults to [project_file_folder]./bin/[configuration]/[framework]/publish/ for a runtime-dependent executable and cross-platform binaries. It defaults to [project_file_folder]/bin/[configuration]/[framework]/[runtime]/publish/ for a self-contained executable.
    In a web project, if the output folder is in the project folder, successive 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.
    Some behaviour depends on the SDK version:
    • .NET Core 3.x SDK and later: If a relative path is specified when publishing a project, the output directory generated is relative to the current working directory, not to the project file location.
      If a relative path is specified when publishing a solution, all output for all projects goes into the specified folder relative to the current working directory. To make publish output go to separate folders for each project, specify a relative path by using the msbuild PublishDir property instead of this option.
    • .NET Core 2.x SDK: If a relative path is specified when publishing a project, the output directory generated is relative to the project file location, not to the current working directory.
      If a relative path is specified when publishing a solution, each project's output goes into a separate folder relative to the project file location. If an absolute path is specified when publishing a solution, all publish output for all projects goes into the specified folder.
    • Type: String
  • project (optional)
    The project or solution (or directory containing a project or solution) to publish. If not specified, the current directory is used.
    Note that the use of a solution instead of a project was added in the .NET Core 3.0 SDK.
    • Type: String
  • properties (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • propertiesString (optional)
    Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax .
    Properties of particular interest to 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.
      Available since .NET Core 3.0 SDK.
    • 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.
      For more information about single-file publishing, see the single-file bundler design document .
      Available since .NET Core 3.0 SDK.
    • 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 .
      Available since .NET Core 3.0 SDK.
    Note that it is recommended to specify all of these, other than PublishProfile, in a publish profile rather than here.
    • Type: String
  • runtime (optional)
    Publishes the application for a given runtime. For a list of Runtime Identifiers (RIDs), see the RID catalog. For more information, see .NET Core application publishing and Publish .NET Core apps with the .NET Core CLI.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • selfContained (optional)
    Publishes the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Enabled by default if a runtime identifier is specified and the project is an executable project (not a library project). For more information, see .NET Core application publishing and Publish .NET Core apps with the .NET Core CLI.
    • Type: boolean
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • shutDownBuildServers (optional)
    If enabled, dotnet build-server shutdown will be executed after the main command, shutting down build servers that may have been started.
    Note: If this is not specified, a build that causes such a build server to be started may hang until 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).

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • unstableIfErrors (optional)
    If this is set and the build completes with errors, the build will be marked as unstable instead of failed.
    • Type: boolean
  • unstableIfWarnings (optional)
    If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
    • Type: boolean
  • verbosity (optional)
    Sets the MSBuild verbosity level.
    • Type: String
  • versionSuffix (optional)
    Defines the version suffix to replace the asterisk (*) in the version field of the project file.
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetNuGetPush: .NET: Publish NuGet package (nuget push)

The 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.
The command pushes an existing package. It doesn't create a package. To create a package, use dotnet pack.
  • apiKeyId (optional)
    The API key for the server.
    • Type: String
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • disableBuffering (optional)
    Disables buffering when pushing to an HTTP(S) server to reduce memory usage.
    • Type: boolean
  • forceEnglishOutput (optional)
    Forces the application to run using an invariant, English-based culture.
    • Type: boolean
  • noServiceEndpoint (optional)
    Doesn't append "api/v2/package" to the source URL.

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • noSymbols (optional)
    Doesn't push symbols (even if present).
    • Type: boolean
  • root (optional)
    Specifies the file path to the package(s) to be pushed.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • skipDuplicate (optional)
    When pushing multiple packages to an HTTP(S) server, treats any 409 Conflict response as a warning so that the push can continue.

    Available since: .NET Core SDK 3.1
    • Type: boolean
  • source (optional)
    Specifies the server URL. Supported URLs for nuget.org include 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).
    This option is required unless DefaultPushSource config value is set in the NuGet config file.
    • Type: String
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • symbolApiKeyId (optional)
    The API key for the symbol server.
    • Type: String
  • symbolSource (optional)
    Specifies the symbol server URL.
    • Type: String
  • timeout (optional)
    Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes). Specifying 0 (zero seconds) applies the default value.
    • Type: int
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetTest: .NET: Run unit tests (test)

The 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.
For multi-targeted projects, tests are run for each targeted framework. The test host and the unit test framework are packaged as NuGet packages and are restored as ordinary dependencies for the project.
  • blame (optional)
    Runs the tests in blame mode. This option is helpful in isolating problematic tests that cause the test host to crash. 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.
    • Type: boolean
  • blameCrash (optional)
    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 the test host 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 using .NET Core 3.1 or 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. Download the tools. Implies --blame.
    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.
    Available since: .NET 5.0 preview SDK
    • Type: boolean
  • blameCrashCollectAlways (optional)
    Collects a crash dump on expected as well as unexpected test host exit.
    Available since: .NET 5.0 preview SDK
    • Type: boolean
  • blameCrashDumpType (optional)
    The type of crash dump to be collected. Implies --blame-crash.
    Available since: .NET 5.0 preview SDK
    • Type: String
  • blameHang (optional)
    Run the tests in blame mode and collects a hang dump when a test exceeds the given timeout.
    Available since: .NET 5.0 preview SDK
    • Type: boolean
  • blameHangDumpType (optional)
    The type of crash dump to be collected. It should be full, mini, or none. When none is specified, the test host is terminated on timeout, but no dump is collected. Implies --blame-hang.
    Available since: .NET 5.0 preview SDK
    • Type: String
  • blameHangTimeout (optional)
    Per-test timeout, in milliseconds, after which a hang dump is triggered and the test host process and all of its child processes are dumped and terminated.
    When used together with data driven tests, the timeout behavior depends on the test adapter used. For xUnit and NUnit the timeout is renewed after every test case. For MSTest, the timeout is used for all test cases. This option is supported on Windows with netcoreapp2.1 and later, on Linux with netcoreapp3.1 and later, and on macOS with net5.0 or later. Implies --blame and --blame-hang.
    Available since: .NET 5.0 preview SDK
    • Type: int
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • collect (optional)
    Enables a data collector for the test run. For more information, see Monitor and analyze test run.
    • Type: String
  • configuration (optional)
    Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
    • Type: String
  • diag (optional)
    Enables diagnostic mode for the test platform and writes diagnostic messages to the specified file and to files next to it. The process that is logging the messages determines which files are created, such as *.host_<date>.txt for the test host log, and *.datacollector_<date>.txt for the data collector log.
    • Type: String
  • filter (optional)
    Filters out tests in the current project using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see Running selective unit tests.
    • Type: String
  • framework (optional)
    Forces the use of 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.
    • Type: String
  • listTests (optional)
    List all of the discovered tests in the current project.
    • Type: boolean
  • logger (optional)
    Specifies a logger for test results. Unlike MSBuild, dotnet test doesn't accept abbreviations: instead of "console;v=d", use "console;verbosity=detailed".
    • Type: String
  • noBuild (optional)
    Doesn't build the project before packing, and does not perform an implicit restore.
    • Type: boolean
  • noRestore (optional)
    Doesn't execute an implicit restore when running the command.
    • Type: boolean
  • nologo (optional)
    Doesn't display the startup banner or the copyright message.

    Available since: .NET Core SDK 3.0
    • Type: boolean
  • option (optional)
    • Type: String
  • options (optional)
    • Type: Array / List of String
  • optionsString (optional)
    For more information about these options, see the MSBuild Command-Line Reference.
    If targets and/or properties are also configured, those will be passed after these options.
    • Type: String
  • outputDirectory (optional)
    Directory in which to find the binaries to run. If not specified, the default path is ./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.
    • Type: String
  • project (optional)
    What to test. This can be one of:
    • Path to a test project.
    • Path to a solution.
    • Path to a directory that contains a project or a solution.
    • Path to a test project .dll file.
    If not specified, it searches for a project or a solution in the current directory.
    • Type: String
  • properties (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • propertiesString (optional)
    Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
    • Type: String
  • resultsDirectory (optional)
    The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created. The default is TestResults in the directory that contains the project file.
    • Type: String
  • runSettings (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • runSettingsString (optional)
    Inline RunSettings values, specified in in Java properties syntax.
    • Type: String
  • runtime (optional)
    The target runtime to test for.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • settings (optional)
    The .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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • shutDownBuildServers (optional)
    If enabled, dotnet build-server shutdown will be executed after the main command, shutting down build servers that may have been started.
    Note: If this is not specified, a build that causes such a build server to be started may hang until 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).

    Available since: .NET Core SDK 2.1
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • testAdapterPath (optional)
    Path to a directory to be searched for additional test adapters. Only .dll files with suffix .TestAdapter.dll are inspected. If not specified, the directory of the test .dll is searched.
    • Type: String
  • unstableIfErrors (optional)
    If this is set and the build completes with errors, the build will be marked as unstable instead of failed.
    • Type: boolean
  • unstableIfWarnings (optional)
    If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
    • Type: boolean
  • verbosity (optional)
    Sets the MSBuild verbosity level.
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetRestore: .NET: Restore project dependencies (restore)

The 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:
Sometimes, it might be inconvenient to run the implicit NuGet restore with these commands. For example, some automated systems, such as build systems, need to call 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.
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • configfile (optional)
    The NuGet configuration file (nuget.config) to use for the restore operation.
    • Type: String
  • disableParallel (optional)
    Disables restoring multiple projects in parallel.
    • Type: boolean
  • force (optional)
    Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file.
    • Type: boolean
  • forceEvaluate (optional)
    Forces restore to reevaluate all dependencies even if a lock file already exists.
    • Type: boolean
  • ignoreFailedSources (optional)
    Only warn about failed sources if there are packages meeting the version requirement.
    • Type: boolean
  • lockFilePath (optional)
    Output location where project lock file is written. By default, this is PROJECT_ROOT\packages.lock.json.
    • Type: String
  • lockedMode (optional)
    Don't allow updating project lock file.
    • Type: boolean
  • noCache (optional)
    Specifies to not cache HTTP requests.
    • Type: boolean
  • noDependencies (optional)
    When restoring a project with project-to-project (P2P) references, restores the root project and not the references.
    • Type: boolean
  • packages (optional)
    Specifies the directory for restored packages.
    • Type: String
  • project (optional)
    Optional path to the project file to restore.
    • Type: String
  • runtime (optional)
    • Type: String
  • runtimes (optional)
    • Type: Array / List of String
  • runtimesString (optional)
    Specifies runtimes for the package restore. This is used to restore packages for runtimes not explicitly listed in the <RuntimeIdentifiers> tag in the .csproj file. For a list of Runtime Identifiers (RIDs), see the RID catalog.
    • Type: String
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • source (optional)
    • Type: String
  • sources (optional)
    • Type: Array / List of String
  • sourcesString (optional)
    Specifies NuGet package sources to use during the restore operation. This setting overrides all of the sources specified in the nuget.config files.
    • Type: String
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • useLockFile (optional)
    Enables the project lock file to be generated and used with restore.
    • Type: boolean
  • verbosity (optional)
    Sets the verbosity level of the command.
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

dotnetToolRestore: .NET: Restore local tools (tool restore)

The 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)
    • Type: String
  • additionalSources (optional)
    • Type: Array / List of String
  • additionalSourcesString (optional)
    Adds additional NuGet package sources to use during installation.
    • Type: String
  • charset (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
    • Type: String
  • configfile (optional)
    The NuGet configuration (nuget.config) file to use.
    • Type: String
  • disableParallel (optional)
    Prevent restoring multiple projects in parallel.
    • Type: boolean
  • ignoreFailedSources (optional)
    Treat package source failures as warnings.
    • Type: boolean
  • noCache (optional)
    Do not cache packages and http requests.
    • Type: boolean
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    If the default is specified, you either need to use the With .NET element (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.
    • Type: String
  • showSdkInfo (optional)
    If enabled, 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.
    • Type: boolean
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean
  • toolManifest (optional)
    Path to the manifest file.
    • Type: String
  • verbosity (optional)
    Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
    • Type: String
  • workDirectory (optional)
    The directory in which to execute the command. By default, this is the current directory (for freestyle jobs, that is the root of the job's workspace).
    • Type: String

withDotNet: With .NET

Prepares an environment for Jenkins to run build steps using a .NET SDK's dotnet utility.
  • sdk (optional)
    Name of a .NET SDK to use so that dotnet will be in the path.
    • Type: String
  • specificSdkVersion (optional)
    Depending on the platform, the 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.
    By enabling this option, the configured SDK home directory will be checked, and if it only includes a single SDK deployment, a global.json file will be created in the current directory, referencing that SDK version and disabling roll-forward.
    Note: This will silently overwrite any global.json already present in the current directory.
    • Type: boolean

Was this page helpful?

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.