Why does NuGet enter a loop when asking for credentials?

NuGet enters a loop when you are not providing the “-Source <source name>” while trying to install a package.

Try adding this to the command and see if it works: 

“Nuget.exe install <package name> -Source <source name>”.

If this is not successful, open your NuGet.config file located in the following location:  “C:Users<your user name>AppDataRoamingNuGet”.

Please remove all the configuration in the file so that it looks like this:

<?xml version=”1.0″ encoding=”utf-8″?>

<configuration>

  <apikeys>

  </apikeys>

  <packageSources>

  </packageSources>

</configuration>

Save the file with no configurations in it and add the new source.

“nuget sources Add -Name <source name of your choice> -Source <url to the repo>”

You can find the command in our wiki page “Publishing to a Local Repository”.

After adding the source you will need to provide the credentials as well:

“nuget setapikey <username>:<password> -Source <source name from the previous command>”.

To push or install a package, you will need to use the following command:

“nuget install <package name> -Source <source name from previous command>”.