Skip to content

NuGet Integration

OrbitRepos provides a high-performance NuGet V3 API compatible repository. It allows you to host private .NET packages and proxy public ones from NuGet.org, providing a fast and reliable feed for your development teams and CI/CD pipelines.

Overview

OrbitRepos supports the modern NuGet V3 protocol, which is faster and more efficient than the older V2 API. Key features include:

  • Hosted Repositories: Store your private .nupkg and .snupkg files.
  • Proxy Repositories: Cache packages from NuGet.org or other external feeds.
  • Group Repositories: Aggregate multiple feeds into a single index.json URL.

The NuGet handler is accessible at the /nuget/{repoName}/ route.

Prerequisites

Before you begin, ensure you have:

  • OrbitRepos instance running (see the Quick Start).
  • .NET SDK (6.0 or later recommended) installed on your machine.
  • An API Token or user credentials with deployer permissions.

Create a Repository

Create a NuGet repository via the OrbitRepos Web UI or API:

  1. Go to Repositories and click Create Repository.
  2. Select NuGet as the format.
  3. Choose a Type (hosted, proxy, or group).
  4. Enter a Name (e.g., nuget-private).
  5. If creating a proxy, set the Remote URL to https://api.nuget.org/v3/index.json.
  6. Click Create.

Push / Publish Artifacts

To publish packages, use the dotnet nuget push command.

1. Pack your project

Generate a NuGet package from your project:

dotnet pack -c Release

2. Push to OrbitRepos

Use the v3/index.json endpoint of your repository:

dotnet nuget push bin/Release/*.nupkg \
  --source http://localhost:8080/nuget/nuget-private/v3/index.json \
  --api-key your-api-token
nuget push bin/Release/*.nupkg \
  -Source http://localhost:8080/nuget/nuget-private/v3/index.json \
  -ApiKey your-api-token

Symbols Packages

OrbitRepos supports symbol packages (.snupkg). They are automatically handled when pushed alongside the main package.

Pull / Install Artifacts

To install packages, add your OrbitRepos repository as a NuGet source.

Add source via CLI

dotnet nuget add source http://localhost:8080/nuget/nuget-private/v3/index.json \
  --name OrbitRepos \
  --username admin \
  --password admin \
  --store-password-in-clear-text

Configure via nuget.config

Create or update a nuget.config file in your project or solution root:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="OrbitRepos" value="http://localhost:8080/nuget/nuget-private/v3/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <OrbitRepos>
      <add key="Username" value="admin" />
      <add key="ClearTextPassword" value="your-api-token" />
    </OrbitRepos>
  </packageSourceCredentials>
</configuration>

Install a package

dotnet add package MyCompany.Common --source OrbitRepos

Proxy Setup

A proxy repository caches packages from NuGet.org to speed up local builds and ensure availability.

  1. Create a proxy repository named nuget-proxy.
  2. Set the Remote URL to https://api.nuget.org/v3/index.json.
  3. Add http://localhost:8080/nuget/nuget-proxy/v3/index.json as a source in your nuget.config.

Using Groups

Create a group repository that includes both your hosted and proxy repositories. This allows you to use a single URL for all your .NET dependencies.

Troubleshooting

Authentication Required

Ensure you have provided valid credentials in nuget.config or via the --api-key flag. For V3 feeds, dotnet often requires the packageSourceCredentials section for authenticated requests.

404 Service Index Not Found

Ensure you are using the full V3 path: .../nuget/{repoName}/v3/index.json. OrbitRepos follows the standard NuGet V3 directory structure.

Package Not Found in Proxy

Verify the remote URL is correct (must end in index.json for NuGet.org V3). Check OrbitRepos logs for any upstream connection errors.

Unable to Push

Verify your user has deployer permissions. Large packages might require increasing the ORBITREPO_SERVER_WRITE_TIMEOUT environment variable if the upload takes more than 5 minutes.