Note that there are some explanatory texts on larger screens.

plurals
  1. PONuGet Package Restore Unable to prompt for credentials with custom feed
    text
    copied!<p>I have enabled NuGet Package Restore in my solution. I am using nuget.exe version 2.0.30828.5. For packages that are in the normal public feed, NuGet Package Restore works fine. That is, if there is nothing in the "Packages" directory and my local NuGet cache (C:\Users\{username}\AppData\Local\NuGet\Cache) is clear, NPR works perfectly.</p> <p>However, when we are trying to use NPR for a package in our custom feed (custom feed has Basic authentication) we get this:</p> <pre><code>EXEC : warning : Unable to prompt for credentials. Consult NuGet's help documentation for ways to specify credentials. c:\&lt;localpath&gt;\.nuget\nuget.targets(80,9): error : Unable to find version '2.0.1.0' of package '&lt;packageName&gt;'. c:\&lt;localpath&gt;\.nuget\nuget.targets(80,9): error MSB3073: The command ""c:\&lt;localpath&gt;\.nuget\nuget.exe" install "c:\&lt;localpath&gt;\packages.config" -source "" -RequireConsent -o "c:\&lt;localpath&gt;\packages"" exited with code 1. </code></pre> <p>When I look at the NuGet code as well as decompiling nuget.exe to find the string <strong>"Unable to prompt for credentials. Consult NuGet's help documentation for ways to specify credentials"</strong> I see it there, but frankly, I am unable to determine who is utilizing that error message.</p> <p>When we add the package (either from the NuGet UI or the Package Manager Console), it prompts for credentials and works fine. This is only a problem on Package Restore.</p> <p>I tried running this command:</p> <pre><code>NuGet.exe source Update -Name {feedname} -UserName {myusername} -Password {mypassword} </code></pre> <p>but gets the same result.</p> <p>Does anyone know how I can specify credentials to a custom NuGet feed using Basic auth for NuGet Package Restore? </p> <p><strong>UPDATE 9/18/2012</strong></p> <p>I have an update on the issue. I observed that when I ran the <strong>nuget.exe source Update...</strong> command, it added the section to the NuGet.config file that was in the .nuget folder local to my solution. I then ran procmon.exe while running the build a noticed this file was not being looked at! Instead it was looking for the NuGet.config file in the "C:\Users{username}\AppData\Roaming\NuGet" directory. I then copy/pasted the section from the local NuGet.config file into the NuGet.config file in the \AppData\Roaming\NuGet directory, and it worked!</p> <p>So...the question is, what is the <strong>correct</strong> best practice for this process?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload