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 : String (optional)
    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
  • configuration : String (optional)
    Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
  • continueOnError : boolean (optional)
    If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
  • force : boolean (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.
  • framework : String (optional)
    Compiles for a specific framework. The framework must be defined in the project file.
  • noDependencies : boolean (optional)
    Ignores project-to-project references and only restores the root project.
  • noIncremental : boolean (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.
  • noRestore : boolean (optional)
    Doesn't execute an implicit restore when running the command.
  • nologo : boolean (optional)
    Doesn't display the startup banner or the copyright message.

    Available since: .NET Core SDK 3.0
  • option : String (optional)
  • options : Array / List of String (optional)
    • optionsString : String (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.
    • outputDirectory : String (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.
    • project : String (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.
    • properties (optional)
      • Type: java.util.Map<java.lang.String, java.lang.String>
    • propertiesString : String (optional)
      Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
    • runtime : String (optional)
      Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the RID catalog.
    • sdk : String (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.
    • showSdkInfo : boolean (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.
    • shutDownBuildServers : boolean (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
    • specificSdkVersion : boolean (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.
    • target : String (optional)
    • targets : Array / List of String (optional)
      • targetsString : String (optional)
        Specifies the MSBuild targets to build. If none are specified, the default target specified in the project will be built.
      • unstableIfErrors : boolean (optional)
        If this is set and the build completes with errors, the build will be marked as unstable instead of failed, and execution will continue to the next step.
      • unstableIfWarnings : boolean (optional)
        If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
      • verbosity : String (optional)
        Sets the MSBuild verbosity level.
      • versionSuffix : String (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.
      • workDirectory : String (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).

      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 : String (optional)
        The character set to use for the step's output. If not specified, the charset associated with the build will be used.
      • configuration : String (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.
      • continueOnError : boolean (optional)
        If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
      • framework : String (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.
      • nologo : boolean (optional)
        Doesn't display the startup banner or the copyright message.

        Available since: .NET Core SDK 3.0
      • option : String (optional)
      • options : Array / List of String (optional)
        • optionsString : String (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.
        • outputDirectory : String (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.
        • project : String (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.
        • properties (optional)
          • Type: java.util.Map<java.lang.String, java.lang.String>
        • propertiesString : String (optional)
          Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
        • runtime : String (optional)
          Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created.
        • sdk : String (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.
        • showSdkInfo : boolean (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.
        • shutDownBuildServers : boolean (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
        • specificSdkVersion : boolean (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.
        • unstableIfErrors : boolean (optional)
          If this is set and the build completes with errors, the build will be marked as unstable instead of failed, and execution will continue to the next step.
        • unstableIfWarnings : boolean (optional)
          If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
        • verbosity : String (optional)
          Sets the MSBuild verbosity level.
        • workDirectory : String (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).

        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 : String (optional)
          The API key for the server.
        • charset : String (optional)
          The character set to use for the step's output. If not specified, the charset associated with the build will be used.
        • continueOnError : boolean (optional)
          If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
        • forceEnglishOutput : boolean (optional)
          Forces the application to run using an invariant, English-based culture.
        • noServiceEndpoint : boolean (optional)
          Doesn't append "api/v2/package" to the source URL.

          Available since: .NET Core SDK 2.1
        • packageName : String (optional)
          Name/ID of the package to delete.
        • packageVersion : String (optional)
          Version of the package to delete.
        • sdk : String (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.
        • showSdkInfo : boolean (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.
        • source : String (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).
        • specificSdkVersion : boolean (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.
        • workDirectory : String (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).

        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 : String (optional)
          The character set to use for the step's output. If not specified, the charset associated with the build will be used.
        • config : String (optional)
          Configuration file containing the NuGet sources to use when searching for newer packages. Requires the --outdated, --deprecated or --vulnerable option.
        • continueOnError : boolean (optional)
          If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
        • deprecated : boolean (optional)
          Lists packages that have been deprecated. Cannot be combined with --vulnerable or --outdated options.

          Available since: .NET Core SDK 3.1.300
        • framework : String (optional)
        • frameworks : Array / List of String (optional)
          • frameworksString : String (optional)
            Displays only the packages applicable for the specified target frameworks.
          • highestMinor : boolean (optional)
            Considers only the packages with a matching major version number when searching for newer packages. Requires the --outdated option.
          • highestPatch : boolean (optional)
            Considers only the packages with a matching major and minor version numbers when searching for newer packages. Requires the --outdated option.
          • includePrerelease : boolean (optional)
            Considers packages with prerelease versions when searching for newer packages. Requires the --outdated option.
          • includeTransitive : boolean (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.
          • outdated : boolean (optional)
            Lists packages that have newer versions. Cannot be combined with --deprecated or --vulnerable options.
          • project : String (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.
          • sdk : String (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.
          • showSdkInfo : boolean (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.
          • source : String (optional)
          • sources : Array / List of String (optional)
            • sourcesString : String (optional)
              The NuGet sources to use when searching for packages. Requires the --outdated>, --deprecated> or --vulnerable> option.
            • specificSdkVersion : boolean (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.
            • verbosity : String (optional)
              Sets the verbosity level of the command.

              Note that this option only has an effect since the .NET 5 SDK.
            • vulnerable : boolean (optional)
              Lists packages that have known vulnerabilities. Cannot be combined with --deprecated or --outdated options.
              Available since: .NET Core SDK 5.0.200
            • workDirectory : String (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).

            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 : String (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.
            • charset : String (optional)
              The character set to use for the step's output. If not specified, the charset associated with the build will be used.
            • continueOnError : boolean (optional)
              If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
            • forceEnglishOutput : boolean (optional)
              Forces the application to run using an invariant, English-based culture.
            • operation : String (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.
            • sdk : String (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.
            • showSdkInfo : boolean (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.
            • specificSdkVersion : boolean (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.
            • workDirectory : String (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).

            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 : String (optional)
              The character set to use for the step's output. If not specified, the charset associated with the build will be used.
            • configuration : String (optional)
              Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
            • continueOnError : boolean (optional)
              If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
            • force : boolean (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.
            • includeSource : boolean (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.
            • includeSymbols : boolean (optional)
              Includes the debug symbols NuGet packages in addition to the regular NuGet packages in the output directory.
            • noBuild : boolean (optional)
              Doesn't build the project before packing, and does not perform an implicit restore.
            • noDependencies : boolean (optional)
              Ignores project-to-project references and only restores the root project.
            • noRestore : boolean (optional)
              Doesn't execute an implicit restore when running the command.
            • nologo : boolean (optional)
              Doesn't display the startup banner or the copyright message.

              Available since: .NET Core SDK 3.0
            • option : String (optional)
            • options : Array / List of String (optional)
              • optionsString : String (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.
              • outputDirectory : String (optional)
                Places the built packages in the directory specified.
              • project : String (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.
              • properties (optional)
                • Type: java.util.Map<java.lang.String, java.lang.String>
              • propertiesString : String (optional)
                Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
              • runtime : String (optional)
                Specifies the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the RID catalog.
              • sdk : String (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.
              • showSdkInfo : boolean (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.
              • shutDownBuildServers : boolean (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
              • specificSdkVersion : boolean (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.
              • unstableIfErrors : boolean (optional)
                If this is set and the build completes with errors, the build will be marked as unstable instead of failed, and execution will continue to the next step.
              • unstableIfWarnings : boolean (optional)
                If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
              • verbosity : String (optional)
                Sets the MSBuild verbosity level.
              • versionSuffix : String (optional)
                Defines the value for the $(VersionSuffix) MSBuild property in the project.
              • workDirectory : String (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).

              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 : String (optional)
                The character set to use for the step's output. If not specified, the charset associated with the build will be used.
              • configuration : String (optional)
                Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
              • continueOnError : boolean (optional)
                If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
              • force : boolean (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.
              • framework : String (optional)
                Publishes the application for the specified target framework. You must specify the target framework in the project file.
              • manifest : String (optional)
              • manifests : Array / List of String (optional)
                • manifestsString : String (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.
                • noBuild : boolean (optional)
                  Doesn't build the project before publishing, and does not perform an implicit restore.
                • noDependencies : boolean (optional)
                  Ignores project-to-project references and only restores the root project.
                • noRestore : boolean (optional)
                  Doesn't execute an implicit restore when running the command.
                • nologo : boolean (optional)
                  Doesn't display the startup banner or the copyright message.

                  Available since: .NET Core SDK 3.0
                • option : String (optional)
                • options : Array / List of String (optional)
                  • optionsString : String (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.
                  • outputDirectory : String (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.
                  • project : String (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.
                  • properties (optional)
                    • Type: java.util.Map<java.lang.String, java.lang.String>
                  • propertiesString : String (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.
                  • runtime : String (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.
                  • sdk : String (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.
                  • selfContained : boolean (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.
                  • showSdkInfo : boolean (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.
                  • shutDownBuildServers : boolean (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
                  • specificSdkVersion : boolean (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.
                  • unstableIfErrors : boolean (optional)
                    If this is set and the build completes with errors, the build will be marked as unstable instead of failed, and execution will continue to the next step.
                  • unstableIfWarnings : boolean (optional)
                    If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
                  • verbosity : String (optional)
                    Sets the MSBuild verbosity level.
                  • versionSuffix : String (optional)
                    Defines the version suffix to replace the asterisk (*) in the version field of the project file.
                  • workDirectory : String (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).

                  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 : String (optional)
                    The API key for the server.
                  • charset : String (optional)
                    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
                  • continueOnError : boolean (optional)
                    If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
                  • disableBuffering : boolean (optional)
                    Disables buffering when pushing to an HTTP(S) server to reduce memory usage.
                  • forceEnglishOutput : boolean (optional)
                    Forces the application to run using an invariant, English-based culture.
                  • noServiceEndpoint : boolean (optional)
                    Doesn't append "api/v2/package" to the source URL.

                    Available since: .NET Core SDK 2.1
                  • noSymbols : boolean (optional)
                    Doesn't push symbols (even if present).
                  • root : String (optional)
                    Specifies the file path to the package(s) to be pushed.
                  • sdk : String (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.
                  • showSdkInfo : boolean (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.
                  • skipDuplicate : boolean (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
                  • source : String (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.
                  • specificSdkVersion : boolean (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.
                  • symbolApiKeyId : String (optional)
                    The API key for the symbol server.
                  • symbolSource : String (optional)
                    Specifies the symbol server URL.
                  • timeout : int (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.
                  • workDirectory : String (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).

                  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 : boolean (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.
                  • blameCrash : boolean (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
                  • blameCrashCollectAlways : boolean (optional)
                    Collects a crash dump on expected as well as unexpected test host exit.
                    Available since: .NET 5.0 preview SDK
                  • blameCrashDumpType : String (optional)
                    The type of crash dump to be collected. Implies --blame-crash.
                    Available since: .NET 5.0 preview SDK
                  • blameHang : boolean (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
                  • blameHangDumpType : String (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
                  • blameHangTimeout : int (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
                  • charset : String (optional)
                    The character set to use for the step's output. If not specified, the charset associated with the build will be used.
                  • collect : String (optional)
                    Enables a data collector for the test run. For more information, see Monitor and analyze test run.
                  • configuration : String (optional)
                    Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
                  • continueOnError : boolean (optional)
                    If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
                  • diag : String (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.
                  • filter : String (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.
                  • framework : String (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.
                  • listTests : boolean (optional)
                    List all of the discovered tests in the current project.
                  • logger : String (optional)
                    Specifies a logger for test results. Unlike MSBuild, dotnet test doesn't accept abbreviations: instead of "console;v=d", use "console;verbosity=detailed".
                  • noBuild : boolean (optional)
                    Doesn't build the project before packing, and does not perform an implicit restore.
                  • noRestore : boolean (optional)
                    Doesn't execute an implicit restore when running the command.
                  • nologo : boolean (optional)
                    Doesn't display the startup banner or the copyright message.

                    Available since: .NET Core SDK 3.0
                  • option : String (optional)
                  • options : Array / List of String (optional)
                    • optionsString : String (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.
                    • outputDirectory : String (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.
                    • project : String (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.
                    • properties (optional)
                      • Type: java.util.Map<java.lang.String, java.lang.String>
                    • propertiesString : String (optional)
                      Additional MSBuild properties to set. These should be specified one per line, in Java properties syntax.
                    • resultsDirectory : String (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.
                    • runSettings (optional)
                      • Type: java.util.Map<java.lang.String, java.lang.String>
                    • runSettingsString : String (optional)
                      Inline RunSettings values, specified in in Java properties syntax.
                    • runtime : String (optional)
                      The target runtime to test for.
                    • sdk : String (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.
                    • settings : String (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.
                    • showSdkInfo : boolean (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.
                    • shutDownBuildServers : boolean (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
                    • specificSdkVersion : boolean (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.
                    • testAdapterPath : String (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.
                    • unstableIfErrors : boolean (optional)
                      If this is set and the build completes with errors, the build will be marked as unstable instead of failed, and execution will continue to the next step.
                    • unstableIfWarnings : boolean (optional)
                      If this is set and the build completes with warnings (but no errors), the build will be marked as unstable instead of successful.
                    • verbosity : String (optional)
                      Sets the MSBuild verbosity level.
                    • workDirectory : String (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).

                    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 : String (optional)
                      The character set to use for the step's output. If not specified, the charset associated with the build will be used.
                    • configfile : String (optional)
                      The NuGet configuration file (nuget.config) to use for the restore operation.
                    • continueOnError : boolean (optional)
                      If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
                    • disableParallel : boolean (optional)
                      Disables restoring multiple projects in parallel.
                    • force : boolean (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.
                    • forceEvaluate : boolean (optional)
                      Forces restore to reevaluate all dependencies even if a lock file already exists.
                    • ignoreFailedSources : boolean (optional)
                      Only warn about failed sources if there are packages meeting the version requirement.
                    • lockFilePath : String (optional)
                      Output location where project lock file is written. By default, this is PROJECT_ROOT\packages.lock.json.
                    • lockedMode : boolean (optional)
                      Don't allow updating project lock file.
                    • noCache : boolean (optional)
                      Specifies to not cache HTTP requests.
                    • noDependencies : boolean (optional)
                      When restoring a project with project-to-project (P2P) references, restores the root project and not the references.
                    • packages : String (optional)
                      Specifies the directory for restored packages.
                    • project : String (optional)
                      Optional path to the project file to restore.
                    • runtime : String (optional)
                    • runtimes : Array / List of String (optional)
                      • runtimesString : String (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.
                      • sdk : String (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.
                      • showSdkInfo : boolean (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.
                      • source : String (optional)
                      • sources : Array / List of String (optional)
                        • sourcesString : String (optional)
                          Specifies NuGet package sources to use during the restore operation. This setting overrides all of the sources specified in the nuget.config files.
                        • specificSdkVersion : boolean (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.
                        • useLockFile : boolean (optional)
                          Enables the project lock file to be generated and used with restore.
                        • verbosity : String (optional)
                          Sets the verbosity level of the command.
                        • workDirectory : String (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).

                        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 : String (optional)
                        • additionalSources : Array / List of String (optional)
                          • additionalSourcesString : String (optional)
                            Adds additional NuGet package sources to use during installation.
                          • charset : String (optional)
                            The character set to use for the step's output. If not specified, the charset associated with the build will be used.
                          • configfile : String (optional)
                            The NuGet configuration (nuget.config) file to use.
                          • continueOnError : boolean (optional)
                            If this is checked, errors encountered will cause the build status to be set to FAILURE (or UNSTABLE, if configured that way), but the build will be allowed to continue. Otherwise, any such errors will cause the build to be terminated immediately.
                          • disableParallel : boolean (optional)
                            Prevent restoring multiple projects in parallel.
                          • ignoreFailedSources : boolean (optional)
                            Treat package source failures as warnings.
                          • noCache : boolean (optional)
                            Do not cache packages and http requests.
                          • sdk : String (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.
                          • showSdkInfo : boolean (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.
                          • specificSdkVersion : boolean (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.
                          • toolManifest : String (optional)
                            Path to the manifest file.
                          • verbosity : String (optional)
                            Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
                          • workDirectory : String (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).

                          withDotNet: With .NET

                          Prepares an environment for Jenkins to run build steps using a .NET SDK's dotnet utility.
                          • sdk : String (optional)
                            Name of a .NET SDK to use so that dotnet will be in the path.
                          • specificSdkVersion : boolean (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.

                          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.