We've set up a ProGet repository in our organization and created a private feed there that stores our internal packages.
Correct username and password has to be sent to ProGet to get access there.
Now, as a part of our CI build, I need to perform NuGet Restore that gets packages from official NuGet feed and/or from our internal ProGet feed. But I can't make it work non-interactively, without the need to manually enter username and password - which is obviously a must for CI process.
Main nuget.config file contains correct feed url (http://nuget.ourCompany.org/nuget/Corporate), username and password.
I run this console command: nuget.exe Restore OurSolution.sln -Verbosity detailed
Sample output for a package from official NuGet feed:
Installing 'AutoMapper 2.2.1'.
Successfully installed 'AutoMapper 2.2.1'.
All packages listed in packages.config are already installed.
Sample output for a package from ProGet private feed:
Using credentials from config. UserName: Developer
Installing 'OurPackage 1.0.2'.
Please provide credentials for: http://nuget.ourCompany.org/api/v2/package/Corporate/OurPackage/1.0.2
And now NuGet.exe expects to read username and password from console input, even though it successfully used nuget.config credentials before.
I've done some debugging in nuget.exe and it turns out that this error is caused by this difference in urls:
Feed url is http://nuget.ourCompany.org/nuget/Corporate, and NuGet doesn't match username/password for it to url http://nuget.ourCompany.org/api/v2/package/...
NuGet would work correctly if ProGet feed url would be like http://nuget.ourCompany.org/api/v2/ or http://nuget.ourCompany.org/api/v2/Corporate, but then ProGet doesn't work.
So my general question is: How to make non-interactive NuGet Restore for a private ProGet feed?
And my specific question is: How to expose ProGet feed with url starting with http://.../api/v2/ , like in official nuget feed (https://www.nuget.org/api/v2/)?