Skip to end of metadata
Go to start of metadata

The NuGet Installer build runner performs NuGet Command-Line Package Restore. It can also (optionally) automatically update package dependencies to the most recent ones.

Supported Operating Systems


NuGet build runners are supported on build agents running Windows OS by default. Linux and macOS are supported when Mono is installed on the agent (only NuGet 3.3+ on Mono 4.4.2+ is supported).


Make sure that sources that you check out from VCS (VCS Settings) include the folder called packages from your solution folder.

NuGet Installer settings:




Select 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.

Path to solution file

Specify the path to your solution file (.sln) where packages are to be installed.

Restore Mode

Select NuGet.exe restore (requires NuGet 2.7+) to restore all packages for an entire solution. The NuGet.exe install command is used to restore packages for versions prior to NuGet 2.7, but only for a single packages.config file.

Restore Options

If needed, select:

  • Exclude version from package folder names: Equivalent to the -ExcludeVersion option of the NuGet.exe install command. If enabled, the destination folder will contain only the package name, not the version number.
  • Disable looking up packages from local machine cache: Equivalent to the -NoCache option of the NuGet.exe

Packages Sources

Specify the NuGet package sources. If left blank, is used to search for your packages.

If you are using a TeamCity NuGet feed, select it using the 'magic wand' icon or manually specify the URL from the NuGet Feed project settings page.

If you use packages from an authenticated feed, configure the NuGet Feed Credentials build feature.

Since TeamCity 2018.2, TeamCity will use the credentials provider to automatically authenticate requests to build-in NuGet feeds or feeds specified in the NuGet feed credentials build features.
Note that API v1/v2 feeds require NuGet 2.0+; NuGet 3.5+ is recommended. API v3 feeds require NuGet 4.8+ or NuGet 4.9+ on Mono.

Update Packages

Update packages with help of NuGet update command: Uses the NuGet.exe update command to update all packages under the solution. The package versions and constraints are taken from packages.config files.

Update Mode

Select one of the following:

  • Update via solution file - TeamCity uses Visual Studio solution file (.sln) to create the full list of NuGet packages to install. This option updates packages for the entire solution.
  • Update via packages.config - Select to update packages via calls to NuGet.exe update Packages.Config for each packages.config file under the solution.

Update Options

  • Include pre-release packages: Equivalent to the -Prerelease option of the NuGet.exe update command
  • Perform safe update: Equivalent to the -Safe option of the NuGet.exe update command, that looks for updates with the highest version available within the same major and minor version as the installed package.

See the NuGet documentation for complete NuGet.exe command line reference.

When you add the NuGet Installer runner to your build configuration, each finished build will have the NuGet Packages tab listing the packages used.

See also:

  • No labels