NuGet Configuration
Configure NuGet for package management in .NET projects.
Prerequisites
- .NET Setup - Install .NET SDK
- Artifactory Setup - Get Artifactory credentials (for Artifactory configuration)
Verify Installation
# Check NuGet sources
dotnet nuget list source
Artifactory
Configure NuGet to use JFrog Artifactory. Requires Artifactory Setup.
- Windows
- macOS
- Linux
# Add Artifactory as a NuGet source
dotnet nuget add source https://your-org.jfrog.io/artifactory/api/nuget/v3/nuget-virtual `
--name "Artifactory" `
--username $env:ARTIFACTORY_USERNAME `
--password $env:ARTIFACTORY_IDENTITY_TOKEN
# Add Artifactory as a NuGet source
dotnet nuget add source https://your-org.jfrog.io/artifactory/api/nuget/v3/nuget-virtual \
--name "Artifactory" \
--username $ARTIFACTORY_USERNAME \
--password $ARTIFACTORY_IDENTITY_TOKEN \
--store-password-in-clear-text
# Add Artifactory as a NuGet source
dotnet nuget add source https://your-org.jfrog.io/artifactory/api/nuget/v3/nuget-virtual \
--name "Artifactory" \
--username $ARTIFACTORY_USERNAME \
--password $ARTIFACTORY_IDENTITY_TOKEN \
--store-password-in-clear-text
Verify Configuration
# List configured sources
dotnet nuget list source
# Test package restore
dotnet restore