Sep 26, 2012 at 5:20 AM
Edited Sep 26, 2012 at 5:30 AM
One machine in our group is having trouble with package restore. When a clean checkout is performed (without packages checked into source control), and we try to build on this machine (either in VS 2010 or VS 2012), the call to nuget.exe to restore the packages
for the solution results in an error 400 Bad Request.
Further inspecting the output window, I've found that nuget.exe is being called with the following parameter and value
The empty string seems to be causing the problem. Here is the full failed command as written to the output window:
D:\Projects\MyProject\.nuget\nuget.targets(80,9): error : The remote server returned an error: (400) Bad Request.
D:\Projects\MyProject\.nuget\nuget.targets(80,9): error : One or more errors occurred.
D:\Projects\MyProject\.nuget\nuget.targets(80,9): error MSB3073: The command ""D:\Projects\MyProject\.nuget\nuget.exe" install "D:\Projects\MyProject\Tests\packages.config" -source "" -RequireConsent
-o "D:\Projects\MyProject\packages"" exited with code 1.
On this machine, I have verified that I can create a new console app and successfully nuget in a package such as log4net. However, once I enable package restore on the solution, I start getting the 400 Bad Request error
If I try nuget.exe with the -source "" parameter and value from the command line, the error returned is
Invalid URI: The format of the URI could not be determined.
So we know that
- The error is not related to the solution. The problem can be replicated on a new project
- The error only occurs when package restore is enabled
- The -source parameter is passed with an empty string value ""
- Installing a new package using the package manager work successfully
- This is the only machine where the error is occuring
- We have verified that the package source is correct: "NuGet official package source" = https://nuget.org/api/v2/
Any help would be greatly appreciated.