dotnet publish
- 17 Feb 2022
- 1 Minute to read
-
Print
-
DarkLight
-
PDF
dotnet publish
- Updated on 17 Feb 2022
- 1 Minute to read
-
Print
-
DarkLight
-
PDF
This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.
dotnet publish
Publishes a .NET Core/Framework/Standard project using dotnet publish.
Script usage:
DotNet::Publish( [SelfContained: <true/false>], Project: <text>, [Configuration: <text>], [PackageSource: <text>], [Framework: <text>], [Runtime: <text>], [Output: <text>], [ForceDependencyResolution: <true/false>], [Verbosity: <integer>], [AdditionalArguments: <text>], [DotNetPath: <text>] );
Arguments:
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
Self-contained | true/false | SelfContained | |
☆ Project path (default) | text | Project | This must be the path to either a project file, solution file, or a directory containing a project or solution file. This argument is required. |
Configuration | text | Configuration | |
Package source | text | PackageSource | If specified, this NuGet package source will be used to restore packages when building. |
Framework | text | Framework | For building multiple target frameworks at once, leave this field blank and also leave "Output" blank. |
Runtime | text | Runtime | |
Output | text | Output | Specifies an output directory for the build. This is only valid if "Framework" is also specified. |
Force dependency resolution | true/false | ForceDependencyResolution | |
Verbosity | integer | Verbosity | |
Additional arguments | text | AdditionalArguments | |
dotnet path | text | DotNetPath | Full path of dotnet.exe (or dotnet on Linux). This is usually C:\Program Files\dotnet\dotnet.exe on Windows. If no value is supplied, the operation will default to %PROGRAMFILES%\dotnet\dotnet.exe for Windows and dotnet (from the path) on Linux. |
Note: This operation requires .NET Core build tools v2.0+ to be installed on the server.
See also:
Example:
# Publish ~\src\MyProject.csproj with Release configuration for .net core 3.1, restoring NuGet packages from the InternalNuGet source DotNet::Publish ~\src\MyProject.csproj ( Configuration: Release, Framework: netcoreapp3.1, Runtime: win-x64, PackageSource: InternalNuGet );
Was this article helpful?