次の方法で共有


Error trying to get the NuGet package source, https://nuget.org/api/v2, through the NuGet Package Manager tool for Visual Studio

Recently my customer kept getting the following error when they were trying to connect to the NuGet package source through the Package Manager tool in Visual Studio:

"ServicePointManager doesn't support proxies with https scheme"

This was odd since they did not specify https as the scheme for their proxy. Instead, they had specified their proxy specifically in their devenv.exe.config file as https://myproxy.corp.com

Turns out that the Package Manager tool in Visual Studio uses the proxy set in IE when it tries to connect to the NuGet package source. In this particular environment the client proxies were being set by IEAK and had INS file settings that looked like this:

 

[Proxy]

HTTP_Proxy_Server=proxy.corp.com:8235

FTP_Proxy_Server=proxy.corp.com:8235

Secure_Proxy_Server=proxy.corp.com:8235

Socks_Proxy_Server=proxy.corp.com:8235

Use_Same_Proxy=1

Proxy_Enable=1

 

The problem was that the scheme was not specified. To correct this, the proxies listed in the INS file should have looked like this:

 

[Proxy]

HTTP_Proxy_Server=https://proxy.corp.com:8235

FTP_Proxy_Server=https://proxy.corp.com:8235

Secure_Proxy_Server=https://proxy.corp.com:8235

Socks_Proxy_Server=https://proxy.corp.com:8235

Use_Same_Proxy=1

Proxy_Enable=1

 

This issue was originally BLOG'd about by Jeff Sanders and pointed out to me by Tim Lovell-Smith. Thanks for the help!