TeamCity integrates with NuGet package manager and provides:
|
On this page:
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.
To do it in TeamCity:
In Add NuGet, select which NuGet versions you want to be installed on agents.
It is recommended to use the release versions of NuGet. |
You can also upload your own NuGet package containing NuGet.exe
instead of downloading it from the public feed using Upload NuGet.
Installing NuGet on agents results in agents upgrade. |
If for some reason you don't want to publish packages to public feed, e.g. you're producing packages that are intended to be used internally; you can use TeamCity as a NuGet Server instead of setting up your own repository.
TeamCity running on any of the supported operating systems (Windows, Linux, Mac OS X) can be used as a NuGet Server. |
To start using TeamCity as a NuGet Server, click Enable on the Administration | NuGet Settings | NuGet Server page (available to server system administrators). Two different links will be displayed on the page: for public (with guestAuth
prefix) and private (with httpAuth
prefix) feed. If Public Url is not available, you need to enable the Guest user login in TeamCity on the Administration | Global Settings page.
When the NuGet Server is enabled, all NuGet packages published as TeamCity build artifacts will be indexed and will appear in NuGet feed. The feed will include the packages from the build configurations where the currently authenticated user has permission to view build artifacts ("View project" permission).
When you have TeamCity NuGet server enabled:
The packages available in the feed are bound to the builds' artifacts: they are removed from the feed when the artifacts of the build which produced them are cleaned up.
Since TeamCity 9.1.4, you do not need to specify credentials for the internal NuGet feed access; if NuGet Feed Credentials are specified, they are ignored.
If the build artifacts are changed under TeamCity Data Directory manually, you need to instruct TeamCity to reindex NuGet feed. For that, click "reset" link for "buildsMetadata" under Administration > Diagnostic > Caches.
Internet Explorer settings may need to be set to trust the TeamCity Server when working in a mixed authentication environment.
For a step-by-step example of NuGet setup see blog post: Setting up TeamCity as a native NuGet Server.
{hidden-data} * You don't need to install NuGet.exe Command Line tool on agents manually: [TeamCity can do it automatically|#installNuGet]. * To install NuGet packages without having to check them in to your VCS and update packages under solution use [NuGet Installer] build step. * build a NuGet package from a given spec file: [NuGet Pack]. * publish ({{push}}) your NuGet packages to a given feed (custom or default): [NuGet Publish] build runner. * {hidden-data} |
Administrator's Guide: NuGet Installer | NuGet Publish | NuGet Pack | NuGet Dependency Trigger |