NuGet
Integration Capabilities
TeamCity integrates with NuGet package manager and when NuGet is installed provides the following capabilities:
Private NuGet feeds based on the builds' published artifacts.
A set of NuGet runners to be used in builds on Windows OS, as well as on Linux and MacOS when Mono is installed on the agent.
the NuGet Installer build runner, which installs and updates NuGet packages
the NuGet Pack build runner, which builds NuGet packages
the NuGet Publish build runner, which publishes packages to a feed of your choice
The NuGet Dependency Trigger, which allows triggering builds on NuGet feed updates.
Typical Usage Scenarios
To install packages from a public feed, add the NuGet Installer build step.
To create a package and publish it to a public feed, add the NuGet Pack and NuGet Publish build steps.
To create a package and publish it to the internal TeamCity NuGet Server, enable TeamCity as a NuGet Server (see the dedicated page), use the NuGet Pack build step and NuGet Publish build steps.
To trigger a new build when a NuGet package is updated, use the NuGet Dependency Trigger.
Installing NuGet to TeamCity agents
The NuGet trigger and the NuGet-related build runners require the NuGet command line binary configured on the server. They are automatically distributed to agents once configured. Several versions can be installed and a version of your choice can be set as the default one.
To install NuGet.exe on TeamCity:
Go to the Administration | Tools tab.
Click Install tool and s elect NuGet.exe.
Select whether you want to download (default) NuGet from the public feed or upload your own NuGet package containing
NuGet.exe.
If the Download radio button is chosen, select the NuGet version to install on all build agents.
If the Upload radio button is selected, choose your own NuGet package.
Specify whether this NuGet version will be default using the related check-box.
Click Add to install the selected NuGet version.
NuGet Packages Cache Clean-up on Agents
NuGet uses several local caches to avoid downloading packages that are already installed, and to provide offline support. If an agent is running out of the space, TeamCity will try to clean NuGet packages cache on the agent.
The caches in the following directories will be cleaned:
%\NUGET_PACKAGES% environment variable
(must be an absolute path)%\LOCALAPPDATA%\NuGet\Cache
%\LOCALAPPDATA%\NuGet\v3-cache
%\user.home%\.nuget\packages
Authentication in private NuGet Feeds
It allows using authentication in build-in NuGet feeds or the feeds specified in the NuGet feed credentials build feature. Supported NuGet feed API versions are as follows:
v1/v2: requires NuGet 2.0+, recommended NuGet 3.5+.
v3: supported since TeamCity 2018.2, requires NuGet 4.8+ (Windows), NuGet 4.9+ on Mono.
Proxy Configuration
NuGet command line client supports proxy server configuration via NuGet.config file parameters or environment variables. See NuGet documentation for more details.