0
votes

I'm trying to create new C# project on VSCode and what ever i do this

(error : Unable to load the service index for source https://api.nuget.org/v3/index.json.)

error keeps showing and i don't know what's wrong with it.

Someone pls help.

C:\Program Files\dotnet\sdk\3.0.100-preview-009812\NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [E:\VScode\CheckRegist\CheckRegist.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009812\NuGet.targets(114,5): error :   A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [E:\VScode\CheckRegist\CheckRegist.csproj]
2

2 Answers

0
votes

Have you tried to update VS Code? Are you able to navigate to that url from a browser? This answer may be of some use: Unable to load the service index for source https://api.nuget.org/v3/index.json in VS2017?.

It seems that there may be a proxy setting (or lack thereof) getting in your way, but it's not entirely clear...

0
votes

I had a similar problem. If you use a proxy with an empty string as password, then this occurs. remove the line with the password settings. Here my settings which solved all my problems stating with NuGet version 4.9.2.5706 :

NOTEPAD %AppData%\NuGet\NuGet.Config

        <configuration>
          <packageSources>
            <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />    
            <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />    
          </packageSources>
          <config>
                <add key="http_proxy" value="http://proxy.xyz.net:8080" />
                <add key="http_proxy.user" value="username" />
                <add key="no_proxy" value="yxz.net" />
          </config>
        <configuration>