---
title: "dotnet pack"
---
Creates a NuGet package from a .net project using the dotnet pack command.
DotNet::Pack(
[Project: <text>],
[Configuration: <text>],
[PackageSource: <text>],
[Output: <text>],
[PackageID: <text>],
[PackageVersion: <text>],
[VersionSuffix: <text>],
[IncludeSymbols: <true/false>],
[IncludeSource: <true/false>],
[Verbosity: <integer>],
[AdditionalArguments: <text>],
[EnsureDotNetInstalled: <text>],
[DotNetPath: <text>]
);
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
Project path | text | Project | This must be the path to either a project file, solution file, or a directory containing a project or solution file. |
Configuration | text | Configuration | |
Package source | text | PackageSource | If specified, this NuGet package source will be used to restore packages when building. |
Output directory | text | Output | The output directory to place built packages in. |
Package ID | text | PackageID | Value note: "not set". |
Package Version | text | PackageVersion | Value note: "not set". |
Version suffix | text | VersionSuffix | Value note: "not set (ignored if Package Version is set)". |
Include symbols | true/false | IncludeSymbols | |
Include source | true/false | IncludeSource | |
Verbosity | integer | Verbosity | Default value is "Minimal". |
Additional arguments | text | AdditionalArguments | |
Ensure dotnet installed | text | EnsureDotNetInstalled | This uses Microsoft's dotnet-install script to ensure that the specified version is installed. Values other than "auto" will be passed to the Channel parameter. The "auto" value will attempt to determine the SDK your project uses and ensure that it is installed. Value note: "not set (do not install)". |
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. Value note: "default". |
Note: This operation works on Windows and Linux as long as dotnet is installed.