NuGet VisualStudio ServicePointManager does not support proxies with https scheme



The ServicePointManager does not support proxies with the https scheme.


Key scenarios


The error is obvious when working with Visual Studio 2019,2017,2015 and lower versions.

The ServicePointManager does not support proxies with the https scheme.  

The complete error prompted in visual studio is

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

The ServicePointManager does not support proxies with the https scheme, error pop up during NuGet package update, because of proxy being removed. 

This article covers - Visual Studio configuration file how a proxy updates excluded and because of that error prompted in visual studio NuGet package manager, and rectifying step by step guide.

Note This is another error solved related solution error in visual studio machine actively refused localhost

No connection could be made because the target machine actively refused it 127.0.0.1 


Now, let's get started...

Why do I get this error?

The main reason is Visual Studio Configuration settings proxy section being removed, as mentioned the above link drives the solution proxy updates. The excluded proxy may affect the target machine to utilize the connectivity. 

Note This article describes Visual Studio 2019 to reproduce the error- will be the same for VS lower

Step 1: Go to Visual Studio any project you created

Step 2: Right click on the project and choose "NuGet package Manager"

Step 3:  Click on Browse tab and you find the Error Occurred window instead of loading packages 


NuGet package loading error


How do I solve this error?

Note.  Please make sure you close the Visual Studio projects if opened.

The next question is the proposed solution is same for Visual Studio 2019, 2017 and lower version as well?

The answer is yes - the solution is applicable for any versions. But the fact is solution need to be applied to respective version of configuration file to see the effect.

Still - I don't get you.

Okay, in simple terms the solution has to be updated proxy flag in devenv.exe

If you are using Visual Studio 2017 and proxy setting need to be updated in VS 2017 configuration.

If you are using Visual Studio 2019 and proxy setting need to be updated in VS 2019 configuration.

Visual Studio 2017 

Step 1: Right Click on the VS 2017 icon and go to properties and copy the target folder path (Properties image below)

OR

Step 1: Go to this folder path directly and find devenv.exe file, open with admin privilege's

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE

Step2 : In devenv.exe file Scroll down to bottom line and locate section <system.net>

Step3:  Now, replace <system.net> section with below section and save

  • <system.net> 
  • <defaultProxy>   
    • <proxy usesystemdefault="False"/> 
    • </defaultProxy>
    • </system.net> 

Step 4: Re - Open Visual Studio Projects 

Step 5: Right click on the solution project, click on NuGet Manger Packages now you should see the listings and no more error. 

Visual Studio 2019 

Step 1: Right Click on the VS 2019 icon and go to properties and copy the target folder path (image below)

OR

Step 1: Go to this folder path directly and find devenv.exe file, open with admin privilege's

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE

Step2 : In devenv.exe file Scroll down to bottom line and locate section <system.net>

Step3:  Now, replace <system.net> section with below section and save

  • <system.net> 
  • <defaultProxy>   
    • <proxy usesystemdefault="False"/> 
    • </defaultProxy>
    • </system.net> 

Step 4: Re - Open Visual Studio Projects 

Step 5: Right click on the solution project, click on NuGet Manger Packages now you should see the listings and no more error. 

Visual Studio 2019, 2017 properties path




( Properties Image

Replacing proxy setting

Proxy settings replace


How do I ensure I solved this error?

Go to the Visual Studio solution project, and right click on the NuGet Package Manager, and you should see the same result of loading packages as below image.

[Solved] The ServicePointManager does not support proxies with the https scheme + NuGet VS

Summary 

This article explained the root cause of why NuGet packages not loading in Visual Studio 2017, 2019 and older version, also explained the step by step solution to rectify the proxy settings in the visual studio configuration file.

There is another article which solves a similar problem while working with Visual Studio - Click here to know more