The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package. If the --include-symbols option is present, another package containing the debug symbols is created.
NuGet dependencies of the packed project are added to the .nuspec file, so they're properly resolved when the package is installed. Project-to-project references aren't packaged inside the project. Currently, you must have a package per project if you have project-to-project dependencies.
By default, dotnet pack builds the project first. If you wish to avoid this behavior, pass the --no-build option. This is often useful in Continuous Integration (CI) build scenarios where you know the code was previously built.
You can provide MSBuild properties to the dotnet pack command for the packing process. For more information, see NuGet metadata properties and the MSBuild Command-Line Reference.
For more details, visit the official website.
- ///