Steps to reproduce
- set nuget
http_proxy as described here
- validate that “classic” nuget actually works
- create new basic app using
dotnet new
- restore packages using
dotnet restore
Actual behavior
log : Restoring packages for C:\TEAH\SRC\HelloWorld\project.json...
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info : ProxyAuthenticationRequired https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json 14ms
log : Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json'.
log : Response status code does not indicate success: 407 (Proxy Authentication Required).
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info : ProxyAuthenticationRequired https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json 10ms
log : Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json'.
log : Response status code does not indicate success: 407 (Proxy Authentication Required).
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info : ProxyAuthenticationRequired https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json 11ms
error: Failed to retrieve information from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json'.
error: Response status code does not indicate success: 407 (Proxy Authentication Required).
error: Failed to retrieve information from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json'.
error: Response status code does not indicate success: 407 (Proxy Authentication Required).
Environment data
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225e
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
I’m currently using Fiddler as a local proxy using the “Automatically Authenticate” rule for our corporate proxy while the nuget config points to http://127.0.0.1:8888. Not very handy, but works as a temporary workaround.
This is pretty huge. I’m experiencing this as well. It’s a complete blocker for us.
I had a similar issue, inside our corporate network, NuGet was not able to restore packages and the error read: “Proxy Access Denied”. I followed two different Posts on StackOverflow to fix this issue.
First, you need to find the address of your proxy server: http://superuser.com/a/346376
And then you can download NuGet and configure it from the command line (http://stackoverflow.com/a/15463892/394348).
This configuration worked for me:
nuget.exe config -set http_proxy=http://YOUR PROXY ADDRESS HEREnuget.exe config -set http_proxy.user=YOUR DOMAIN\YOUR WINDOWS IDIn my case I didn’t need to set my password which is good. Hope this helps
@brthor @degrim, I’m wondering … I got the issue too, and here is all I tried 😃
I’ve installed .Net Core RC 2 Preview One on top of Vs2015.2 I’ve also installed the nuget Vsix 3.5.0 beta
I’m created a new Web>Asp.Net Core Web Application (.NET Framework) named “ReactDemo”
When I try to Right click on the node “References> Restore packages” here is the full log :
When I try in the command prompt from one of these folders : "D:\Sources\ReactDemo" "D:\Sources\ReactDemo\src" “D:\Sources\ReactDemo\src\ReactDemo”
Then I went to nuget.org and downloaded “nuget.exe” (v3.4.x) and within the folder “D:\Sources\ReactDemo\src\ReactDemo”
This is actually working …
That beeing said … I tried it after removing : %USERPROFILE%.nuget\packages %ProgramData%\NuGet\Config (temporaly)
I’ve disabled the Offline nuget feed from nuget.config : Can be found here : %AppData%\NuGet\Nuget.Config (or uncheck from VS IDE)
<disabledPackageSources> <add key="Microsoft Visual Studio Offline Packages" value="true" /> </disabledPackageSources>I’ve also tried with AND WITHOUT nuget settings : HTTP_PROXY / HTTP_PROXY.USER / HTTP_PROXY.PASSWORD It still works without :
NuGet Config files used: C:\Users\ahertogs031416\AppData\Roaming\NuGet\NuGet.Config C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config
Feeds used: https://www.nuget.org/api/v2/
Installed: 48 package(s) to D:\Sources\ReactDemo\src\ReactDemo\project.json
That beeing said how can dotnet restore fail on proxy when nuget restore works if quote : dotnet restore simply forwards to NuGet.
Thankyou @juanreyesv
To reiterate the steps:
In my case, I’m using cntlm to interface with my proxy.
I still have issues with this and don’t know whom to blame 😉 IMO, even if
dotnet restore“does nothing but invoke this dll”, it’s too easy to hand over the responsibility to another project - maybe you have to call it with another parameter/setting/environment variable/you name it…What I’ve investigated so far:
nuget restoreworks like a charm with and without the settingshttp_proxy,http_proxy.userandhttp_proxy.passwordinnuget.exe.config(nuget v3.5.0.1996)… Without the settings it uses the system settings.However,
dotnet restoredoesn’t work at all here (dotnet 1.0.0-preview2-1-003177) And I even can see the reason (with WireShark):nuget restore :CONNECT api.nuget.org:443 HTTP/1.1 , NTLMSSP_AUTH, User: DOMAIN\USERdotnet restore:CONNECT api.nuget.org:443 HTTP/1.1 , NTLMSSP_AUTH, User: PROXY_DOMAIN\USERWith
PROXY_DOMAINI really mean the domain part of thehttp_proxy-setting (or system setting), and this is just wrong here (maybe someone else could confirm that behaviour).I doublechecked if the config file is used by
dotnet, too - and it is used (at least partly as also mentioned by @veb82).If I add
http_proxy, the proxy is used, otherwise not (so yes, the config file is used). If I addhttp_proxy.user(“DOMAIN\User”, “User” only, wrong user), nothing happens. If I add a username to the proxy url, nothing happens, too…So it seems that
dotnet restoreonly uses the domain part of the proxy setting.I see that
dotnet restoreinternally calls msbuild.exe, so @jbeacham’s solution might work, but (currently) not for me…edit My latest investigation: In my company we have a pac-script that splits the incoming proxy requests onto multiple proxy servers (simple loadbalancing based on the ip-adress) If I use one of those proxys directly as
http_proxy, it works… (not a solution I like - but it’s the first time I getdotnet restoreto work here). Maybe that’s the reason why not everyone behind a proxy has such problems…@gafemoyano @axelheer @Michael-D-Pine Opening Fiddler was the only way I could restore packages successfully as well. There is a setting in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config file that was setting the defaultProxy and causing my get package requests to certain nuget domains to timeout.
<system.net> <defaultProxy> <proxy usesystemdefault="true" /> </defaultProxy> </system.net>Setting usesystemdefault=“false” fixed my issue.
@Michael-D-Pine try setting the
http_proxyvalue of the NuGet Config File to point to your local CNtlm installation (e.g.http://127.0.0.1:3128)