I have a private nuget server from which I am trying to pull packages (eventually Azure build agent, but first I try it locally).
I am using 2.7 NuGet, that is, I do not need the .NuGet folder (along with .exe and .targets). I have a nuget.config file in the solutions directory.
I know that nuget.config is matched because it finds my remote repository, but the credentials provided in the config are not used.
Here is my configuration:
<?xml version="1.0" encoding="utf-8"?> <configuration> <activePackageSource> <add key="All" value="(Aggregate source)" /> </activePackageSource> <packageSources> <add key="https://www.nuget.org/api/v2/" value="https://www.nuget.org/api/v2/" /> <add key="myrepo" value="http://myrepo:81/nuget/myfeed" /> </packageSources> <disabledPackageSources /> <packageSourceCredentials> <myrepo> <add key="Username" value="user" /> <add key="ClearTextPassword" value="pass" /> </myrepo> </packageSourceCredentials> </configuration>
What can cause nuget to ignore these credentials? I checked with Fiddler and no credentials are sent, and the server responds 401 (correctly):
Error 1 NuGet Package restore failed for project MyProject: The remote server returned an error: (401) Unauthorized.. 0 0
James source share