Skip to end of metadata
Go to start of metadata
Table of Contents

Overview

Since version 2.5, Artifactory provides complete support for NuGet repositories enhanced by Artifactory's existing support for advanced artifact management.

The NuGet support in Artifactory provides:

  1. Provisioning NuGet packages from Artifactory to NuGet clients from all repository types
  2. Metadata calculation for NuGet packages hosted in Artifactory's local repositories
  3. Remote NuGet repository proxying and caching
  4. Multiple NuGet repository aggregation through virtual repositories
  5. NuGet tool (Visual Studio extension, CLI) compatible APIs for package deployment and removal

Metadata updates

NuGet metadata is calculated automatically when adding and removing NuGet packages (including package moving and copying).

Configuration

Local and Remote Repositories

To enable NuGet package metadata calculation on repositories, browse the Artifactory user interface to the desired repository configuration.

When configuring local and remote repositories select the Packages tab:

Remote Paths Configuration

Since different implementations of NuGet servers may provide package resources on different paths, feed and download resource locations are customizable when proxying a remote NuGet repository.

For example, NuGet gallery exposes its feed resource at https://nuget.org/api/v2/Packages and its download resource at https://nuget.org/api/v2/package

The gallery's repository URL points to https://nuget.org, and its feed context path to api/v2 and its download context path to api/v2/package.

On the other hand, the NuGet.Server module exposes its feed resource at http://myhost:myport/nuget/Packages and its download resource at http://myhost:myport/api/v2/package.

The server's repository URL points to http://myhost:myport, its feed context path to nuget and its download context path to api/v2/package.

NuGet metadata calculation is asynchronous and is throttled per repository and package ID; Artifactory invokes the actual calculation only after a certain "quiet period" following an action involving update or removal of an NuGet package.

For this reason, the creation of the metadata normally occurs 30-60 seconds after a package-related action has completed.

Virtual Repositories

Virtual Repositories aggregates NuGet packages from local and remote repositories under the virtual repository that has NuGet support enabled. This allows one to resolve NuGet packages from a single URL (the one of the virtual repository) containing both hosted and proxied libraries.

When configuring virtual repositories select the NuGet tab:

Usage

Artifactory exposes its NuGet resources via the REST API at the following URL: http://myhost/artifactory/api/nuget/repoKey.

This location handles all NuGet related requests (search, download, upload, delete) and supports both V1 and V2 requests.

Using the NuGet Visual Studio Extension:

Using the NuGet command line bootstrapper:

NuGet API Key Authentication

NuGet tools require that sensitive operations such as push and delete authenticate with the server using an API key. The API key you should use is in the form of username:password, where the password can be either clear-text or encrypted.

Viewing Individual NuGet Package Information

It is also possible to view all the metadata annotating a NuGet package by choosing the NuPkg file in Artifactory's tree browser and selecting the NuPkg Info tab:

  • No labels