Skip to main content

NuGet Repositories

Note

Notable Compatibility Change for H2 or PostgreSQL Database Deployments

In Sonatype Nexus Repository release 3.43.0, we added compatibility with official NuGet v2 clients. The supported subset of the legacy NuGet v2 protocol is the same as that supported by Microsoft's NuGet Gallery, nuget.org. Use cases that rely on the deprecated parts of the v2 API are not supported, including many common Chocolatey use cases and some custom OData queries.

With the creation of the NuGet project, a package management solution for .NET developers has become available. Similar to Apache Maven dependency management for Java developers, NuGet makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework.

The project website at www.nuget.org hosts tool downloads and detailed documentation as well as links to further resources and provide a repository and features to upload your open-source NuGet packages. With the NuGet Gallery, a repository of open-source libraries and tools is available and the need for repository management arises.

Nexus Repository Manager Pro and Nexus Repository Manager OSS support the NuGet repository format for hosted and proxy repositories as well as exposing them to the client-side tools as a repository group and have related repositories preconfigured.

Nexus Repository Manager and NuGet allow you to improve collaboration and control while speeding up .NET development, by facilitating open-source libraries and sharing of internal components across teams. When you standardize on a single repository for all your development and use it for internal components, as well, you will get all the benefits of using a repository manager when working in the .NET architecture.

To share a library or tool with NuGet, you create a NuGet package and store it in the NuGet repository on the repository manager. Similarly, you can use packages others have created and made available in their NuGet repositories by proxying them or downloading the packages and pushing them to your own hosted repository for third-party packages.

NuGet Repository Format

The NuGet repository format uses OData queries for communication between the client and the repository. These queries include metadata information about available packages and other data.

When the repository manager receives queries from the NuGet client, it passes these queries on to the remote repositories. To avoid sending identical queries to the remote repository, the repository manager caches the queries and will rely on previously stored metadata if the same query is received again before the cache expires.

The NuGet section is included in NuGet proxy repositories to allow configuration of this caching. Specifically, the parameter Metadata query cache age can be used to configure the rate at which queries expire and are subsequently re-run.

Warning

The --skip-duplicate option is not currently supported for NuGet repositories