TeamCity 7.0 Help

NuGet Pack

NuGet Pack build runner allows to build a NuGet package from a given spec file. If you want to publish this package, add one more build step called NuGet Publish.

To configure NuGet Pack:

  1. Select NuGet version to use from the NuGet.exe drop-down list (if you have NuGet), or specify custom path to NuGet.exe.

  2. Specify your package parameters:

    • Enter path(s) to csproj or nuspec file(s). You can specify as many specification files here as you need. Wildcards are supported. If you specify here a csproj file, you won't have to redefine version number and copyright information in the spec file.

    • Specify version for the package. You can use TeamCity variable %\build.number% here.

    • Specify base directory, where the files defined in the nuspec file are located (the directory against which the paths in <files></files> from nuspec are resolved, usually some bin directory). If left blank, TeamCity will use build checkout directory as base directory.

  3. In the "Output Directory" field, specify the path where generated NuGet package should be put. Optionally, you can clean this directory before packing. If you're using TeamCity as NuGet repository, select the Publish created packages to build artifacts check box to publish packages to TeamCity's NuGet server and be able to use them as regular TeamCity artifacts.

  1. Set additional parameters, if needed:

    • Exclude files: specify one or more wildcard patterns to exclude when creating a package. Equavalent to NuGet.exe -Exclude argument.

    • Properties: Semicolon or new line separated list of package creation properties. For example to make a release build you define here Configuration=Release.

    • Options: Select whether the output files of the project should be in the tool folder. Select whether a package containing sources and symbols should be created. When specified with a nuspec, creates a regular NuGet package file and the corresponding symbols package (needed for publishing the sources to Symbolsource)

    • Set "Additional commandline arguments" to be passed to NuGet.exe.

Last modified: 20 April 2023