Skip to content

NuGet Configuration Management

Configure package sources and NuGet settings.

NuGet uses hierarchical configuration:

  • Machine-level: %ProgramFiles(x86)%\NuGet\Config
  • User-level: %AppData%\NuGet\NuGet.Config
  • Solution-level: nuget.config in solution directory
  1. Open NuGet Manager settings
  2. Click “Add Source”
  3. Enter name and URL
  4. Save configuration
  1. Open NuGet Manager settings
  2. Select the source
  3. Click “Remove”
  4. Confirm removal

Toggle sources on/off without removing them:

  1. Open NuGet Manager settings
  2. Use the checkbox next to each source
  3. Disabled sources won’t be searched
https://api.nuget.org/v3/index.json
https://pkgs.dev.azure.com/{organization}/_packaging/{feed}/nuget/v3/index.json
C:\LocalPackages

Key settings you can configure:

  • Default push source
  • Package sources
  • Credentials
  • Proxy settings
  • Cache locations
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="MyPrivateFeed" value="https://my-feed.com/nuget" />
</packageSources>
<packageSourceCredentials>
<MyPrivateFeed>
<add key="Username" value="user" />
<add key="ClearTextPassword" value="password" />
</MyPrivateFeed>
</packageSourceCredentials>
</configuration>
  • Keep nuget.config in source control
  • Don’t commit credentials
  • Use credential injection for security
  • Document custom feeds for team members

If configuration isn’t applied:

  1. Check file location
  2. Verify XML syntax
  3. Restart VS Code
  4. Check for conflicts between config levels