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
.nupkgand.snupkgfiles. - Proxy Repositories: Cache packages from NuGet.org or other external feeds.
- Group Repositories: Aggregate multiple feeds into a single
index.jsonURL.
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
deployerpermissions.
Create a Repository¶
Create a NuGet repository via the OrbitRepos Web UI or API:
- Go to Repositories and click Create Repository.
- Select NuGet as the format.
- Choose a Type (
hosted,proxy, orgroup). - Enter a Name (e.g.,
nuget-private). - If creating a
proxy, set the Remote URL tohttps://api.nuget.org/v3/index.json. - 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:
2. Push to OrbitRepos¶
Use the v3/index.json endpoint of your repository:
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¶
Proxy Setup¶
A proxy repository caches packages from NuGet.org to speed up local builds and ensure availability.
- Create a
proxyrepository namednuget-proxy. - Set the Remote URL to
https://api.nuget.org/v3/index.json. - Add
http://localhost:8080/nuget/nuget-proxy/v3/index.jsonas a source in yournuget.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.