NuGet and VS2013 ignore packageSourceCredentials in nuget.config

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 
+6
source share
1 answer

Use the NuGet Package Management dialog box! Do not rely on creating / rebuilding in Visual Studio, expecting it to repair missing packages. Open “Manage NuGet packages” for the project (right-click on the failed project and select the option), and you will see the message “Some packages are missing for this project ...” with the “Restore” button. Restoring with this button will fix these authentication issues.

+3
source

Source: https://habr.com/ru/post/970579/


All Articles