This project is read-only.


Hierarchical nuget.config doesn't use credentials during package restore


I'm trying to get NuGet package restore working from a private HTTPS feed during an automated build on TfsPreview.

AFAIK, there's no NuGet.config or NuGet.exe available in the build account's roaming profile.
I have a local nuget.config in my $(SolutionDir).nuget folder

<?xml version="1.0" encoding="utf-8"?>
<add key="disableSourceControlIntegration" value="true" />
<add key="somefeedname" value="" />
<add key="somefeedname" value="" />
<add key="" value="MyEncryptedApiKey..." />
  <add key="Username" value="MyUsername" />
  <add key="Password" value="MyEncryptedPassword..." />

Below you find the relevant log messages for the error, showing that nuget.exe doesn't seem to have found the required credentials.

Using "Exec" task from assembly "Microsoft.Build.Tasks.v4.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Exec" (TaskId:11)
Task Parameter:Command="C:\a\src.nuget\nuget.exe" install "C:\a\src\ComponentA\packages.config" -source "" -RequireConsent -solutionDir "C:\a\src\ " -verbosity detailed (TaskId:11)
Task Parameter:LogStandardErrorAsError=True (TaskId:11)
"C:\a\src.nuget\nuget.exe" install "C:\a\src\ComponentA\packages.config" -source "" -RequireConsent -solutionDir "C:\a\src\ " -verbosity detailed (TaskId:11)
Please provide credentials for: (TaskId:11)
C:\a\src.nuget\nuget.targets(88,5): error : Cannot prompt for input in non-interactive mode. [C:\a\src\ComponentA\ComponentA.csproj]
UserName: (TaskId:11)
C:\a\src.nuget\nuget.targets(88,5): error MSB3073: The command ""C:\a\src.nuget\nuget.exe" install "C:\a\src\ComponentA\packages.config" -source "" -RequireConsent -solutionDir "C:\a\src\ " -verbosity detailed" exited with code 1. [C:\a\src\ComponentA\ComponentA.csproj]
Done executing task "Exec" -- FAILED. (TaskId:11)

This makes me think that nuget.exe still looks for credentials in the global nuget.config file.
The weird thing is: I noticed running the exact same restore command works perfectly on my local development machine (empty global nuget config only has pkg restore consent set).
Closed Nov 10, 2012 at 3:46 AM by ClayCompton
Regression testing with the latest 2.2 build reveals no issues.