cannot load nuget feed in visual studio

2019-07-25 15:46发布

I am getting the following error when I try to load nget:

Unable to load the service index for source https://api.nuget.org/v3/index.json. The ServicePointManager does not support proxies with the https scheme.

Also, in Linqpad, I am getting a similar error:

ServicePointManager does not support proxies with the https scheme

Does anyone have any solutions for this? I found this post, but that solution, clearing the temp folders, did not fix my problem. Please help! Thanks!

3条回答
Root(大扎)
2楼-- · 2019-07-25 15:59

The ServicePointManager does not support proxies with the https scheme.

Since you have proxy configured in the web.config, you may need to pay attention to the syntax of proxy.

You will also get this error if you set something like this in your web.config file: proxyAddress="127.0.0.1:8888" You need list the scheme like this: proxyAddress="http://127.0.0.1:8888" (Add http://). The only scheme that is recognized by this class is http.

Besides, since you have proxy configured in you machine, NuGet will fail to access to the server. You should add proxy settings into Nuget.Config file, goto %AppData%\NuGet\NuGet.config, add below settings:

  <config>
    <add key="HTTP_PROXY" value="http://127.0.0.1:8888" />
  </config>

You can refer to the NuGet Proxy Settings for more detailed info.

查看更多
仙女界的扛把子
3楼-- · 2019-07-25 16:06

Found the problem! I basically just needed to remove the proxy setting from nuget and it looks like the command line was the best place for it. Thanks to @Leo-MSFT for the helpful suggestions.

Console output

Update: [8/8/2017] The problem has reemerged but this time, my fix won't save me since its still applied. I've checked all 3 spots for the nuget proxy settings and its still not working. I have no idea what's wrong now. Grrrr!!!!

Update: [8/8/2017, part deux] Found it! I had fiddler set in the machine.config as well, so make sure to check that if you are prone to forgetfulness like I am.

<system.net>
<!-- <defaultProxy
                enabled = "true"
                useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>-->
</system.net>
查看更多
ゆ 、 Hurt°
4楼-- · 2019-07-25 16:12

Fiddler was the culprit in my case too. I had to comment proxy settings from machine.config residing in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config.

<system.net>
<!-- <defaultProxy enabled="true" useDefaultCredentials="true">
    <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false"/> 
</defaultProxy> -->
</system.net>
查看更多
登录 后发表回答