Learn how to configure NuGet and the .NET SDK to use DepAegis as a private package source for restoring and publishing packages.
The fastest way to add DepAegis as a package source is with the dotnet CLI. Provide an API key or access token for authentication:
dotnet nuget add source "https://app.depaegis.com/api/v1/nuget/v3/index.json" \
--name "DepAegis" \
--username "your-username" \
--store-password-in-clear-text \
--password "your-api-key"--store-password-in-clear-text flag is required on non-Windows platforms where the credential provider cannot use the OS keychain. On Windows, credentials are stored securely in the Windows Credential Manager by default.You can also configure the source directly in a nuget.config file. Place this file in your project root, repository root, or user-level profile directory:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org"
value="https://api.nuget.org/v3/index.json" />
<add key="DepAegis"
value="https://app.depaegis.com/api/v1/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<DepAegis>
<add key="Username" value="your-username" />
<add key="ClearTextPassword" value="your-api-key" />
</DepAegis>
</packageSourceCredentials>
</configuration>nuget.config files for credentials. See the Access Tokens guide for secure token management.DepAegis uses API keys to authenticate NuGet operations. You can generate a key from the DepAegis dashboard under Settings → Access Tokens.
API keys can be scoped to:
To set the API key used for publishing, use the dotnet nuget push --api-key flag or configure it in your nuget.config:
dotnet nuget setapikey "your-api-key" --source "DepAegis"DepAegis integrates seamlessly with Visual Studio's NuGet Package Manager. Once you've added the source (via CLI or nuget.config), it appears in the Package Manager UI:
For credential prompts, Visual Studio uses the NuGet Credential Provider for Visual Studio. DepAegis supports standard HTTP basic authentication, which Visual Studio handles natively.
Most teams use DepAegis for private packages alongside the public nuget.org feed. NuGet supports multiple sources simultaneously. Use the <clear /> element to start fresh, then add both:
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="DepAegis" value="https://app.depaegis.com/api/v1/nuget/v3/index.json" />
</packageSources>NuGet will search all enabled sources in parallel when restoring packages. To ensure private packages are resolved from DepAegis and public packages from nuget.org, you can use the packageSourceMapping feature introduced in NuGet 6.0+:
<packageSourceMapping>
<packageSource key="DepAegis">
<package pattern="MyCompany.*" />
<package pattern="InternalLib.*" />
</packageSource>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>MyCompany.*) are always resolved from DepAegis, preventing dependency confusion attacks.After adding the source, verify it is correctly configured:
dotnet nuget list sourceYou should see output similar to:
Registered Sources:
1. nuget.org [Enabled]
https://api.nuget.org/v3/index.json
2. DepAegis [Enabled]
https://app.depaegis.com/api/v1/nuget/v3/index.jsonTo test that authentication works, try restoring a known private package:
dotnet restore --source "DepAegis"