Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:09:09+00:00 2026-06-11T17:09:09+00:00

I have enabled NuGet Package Restore in my solution. I am using nuget.exe version

  • 0

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.

However, when we are trying to use NPR for a package in our custom feed (custom feed has Basic authentication) we get this:

EXEC : warning : Unable to prompt for credentials. Consult NuGet's help documentation for ways to specify credentials.
c:\<localpath>\.nuget\nuget.targets(80,9): error : Unable to find version '2.0.1.0' of package '<packageName>'.
c:\<localpath>\.nuget\nuget.targets(80,9): error MSB3073: The command ""c:\<localpath>\.nuget\nuget.exe" install "c:\<localpath>\packages.config" -source ""  -RequireConsent -o "c:\<localpath>\packages"" exited with code 1.

When I look at the NuGet code as well as decompiling nuget.exe to find the string “Unable to prompt for credentials. Consult NuGet’s help documentation for ways to specify credentials” I see it there, but frankly, I am unable to determine who is utilizing that error message.

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.

I tried running this command:

NuGet.exe source Update -Name {feedname} -UserName {myusername} -Password {mypassword}

but gets the same result.

Does anyone know how I can specify credentials to a custom NuGet feed using Basic auth for NuGet Package Restore?

UPDATE 9/18/2012

I have an update on the issue. I observed that when I ran the nuget.exe source Update… 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!

So…the question is, what is the correct best practice for this process?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:09:10+00:00Added an answer on June 11, 2026 at 5:09 pm

    I have this working now. This is what I did to get to get it to work. First, it appears the command:

    NuGet.exe source Update -Name {feedname} -UserName {myusername} -Password {mypassword}
    

    IS the right way to go about it. The caveat is that, when your run the “nuget.exe source Update” command, nuget.exe will look for a NuGet.config file in the same directory as the nuget.exe being executed if it exists. IF it exists, it will store the changes there. If it does NOT exist, it will store the changes in the NuGet.config file located in the %AppData%\NuGet directory.

    The additional caveat is that, when Package Restore gets executed as part of the build, it only looks at the NuGet.config file in the %AppData%\NuGet directory and ignores the NuGet.config file that is in the same directory of the nuget.exe being executed (I’m unsure if this is a bug or intentional).

    So, you should run this command using a nuget.exe that is in a directory that does not have a NuGet.config file in it to ensure the changes get stored in the correct NuGet.config file in the %AppData%\NuGet directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When enabling NuGet package restore, it adds the following to my solution: /.nuget /.nuget/NuGet.exe
I added the recent nuget package restore feature to a solution using 'Enable NuGet
I have enabled the static analyzer, but it is telling me that at the
I have enabled site-wide Django caching , but the third-party apps I am using
I have enabled google Minify in code igniter using this library on our website.
I have a combobox that I have Enabled = false. When that is the
I have enabled tooltips in my JTable by overriding the JComponent method that the
I have enabled OpenMP using following settings on 10.7.2 OS (Xcode): GCC_VERSION = 4.2
I have a simple class library project (with Class1 ) and have enabled NuGet
I have enabled unique_ptr in gcc 4.4.6 using the -std=c++0x option. It appears to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.