A few years ago I blogged about how to add a global package source on your build server. Over the years NuGet has evolved and the approach described in that blog post no longer applies.
For the latest NuGet version, the config files are located here:
- %appdata%\NuGet\NuGet.config
You can either directly manipulate the values inside this NuGet.config or you can add an extra package source through the nuget sources command:
- nuget sources add -Name “My Custom Package Source” – Source https://myfeedlocation/nuget/v3/index.json
More information: https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-sources
Remark 1: This config file is scoped to the current user. So it is important to execute this using the user account used for your build agent.
Remark 2: If possible I would recommend to avoid this approach and add a nuget.config to your solution or project instead. Add the reference to the package source in there. The advantage of doing that is that it will work on a clean system without any configuration changes.