Skip to end of metadata
Go to start of metadata

The NuGet Publish build runner is intended to publish (push) your NuGet packages to a given feed (custom or default).


When using TeamCity as a NuGet server, there are two ways to publish packages to the feed:

  • as build artifacts of the NuGet Pack build step using the Publish created packages to build artifacts checkbox - in this case you do not need the NuGet Publish build step
  • via the NuGet Publish build step (since TeamCity 2017.1)

Supported Operating Systems


NuGet build runners are supported on build agents running Windows OS by default.  Since TeamCity 2017.1 Linux and Mac OSX are supported when Mono is installed on the agent (NuGet command-line executable for Windows version 3.2 and later is strongly recommended with Mono).


This page describes the NuGet Publish runner options:




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


An appropriate version of .NET Framework installed on the agent machine is required depending on the NuGet.exe version used: NuGet 2.8.6+ requires .NET 4.5+, earlier NuGet versions require .NET 4.0.


Specify a newline-separated list of NuGet package files (.nupkg) to publish to the NuGet feed. List packages individually or use wildcards.

API key

Specify the API key to access a NuGet packages feed.

To publish to the TeamCity NuGet server, specify the %teamcity.nuget.feed.api.key% parameter.

Package Source

Specify the destination NuGet packages feed URL to push packages to, e.g. Leave blank to let NuGet decide what package repository to use.

To use the TeamCity internal NuGet server, specify %teamcity.nuget.feed.server% for guest-visible package source or %teamcity.nuget.feed.auth.server% to use TeamCity authenticated package source.

Replacing existing package version in TeamCity internal feed

When publishing a package with the same version that already exists on the TeamCity internal NuGet server, the package will be rejected. (The package version may stay the same when building a solution with a lot of projects, and only one project has changed.) To force TeamCity server to replace the existing NuGet package with the new version, append your server url with the ?replace=true parameter, e.g. %teamcity.nuget.feed.server%?replace=true

Command line parametersEnter additional parameters to use when calling the nuget push command.

See also:

Administrator's Guide: NuGet Installer | NuGet Pack

  • No labels