0

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]
Battulga
  • 3
  • 4

2 Answers2

0

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...

Eric D
  • 46
  • 3
  • I just installed my VS code recently and im not able to navigate to that url. – Battulga Jan 10 '19 at 02:09
  • I don't know if you are using fiddler or checking the traffic via developer tools in your browser (using can be opened by hitting F12), but if you cannot get to that url in a browser then you will not get to the extensions. I found this article which may be useful... https://github.com/NuGet/Home/issues/2239. Sorry I don't have a better suggestion... – Eric D Jan 11 '19 at 03:49
0

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>

Reto
  • 102
  • 3