Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget connection attempt failed "Unable to load the service index for source"

You need to add proxy settings into Nuget.Config file. Refer to this link for details: Nuget Config Section & Nuget Proxy Settings.


Deleting the %AppData%\NuGet\NuGet.Config and restarting VS2019 worked for me.

Similar to https://github.com/NuGet/Home/issues/3281


Open Registry Editor by pressing Win + R and type regedit Enter

Navigate to:

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client

Change the value of DisabledByDefault key 0 to 1

Then restart the Visual Studio.

Read more about TLS
Read more about this issue w.r.t. NuGet


I was getting the same error while trying to browse the NuGet Package, to resolve the same followed below step:

1- go to %appdata%\NuGet\NuGet.config

2- Verify the urls mentioned in that config

3- Remove the url which is not required

4- Restart visual studio and check


I have stumbled across this issue when trying to run nuget.exe via Jenkins (configured as a service, by default using Local System account). I have edited C:\Windows\System32\config\systemprofile\AppData\Roaming\NuGet\NuGet.Config file which looks like the following:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <config>
        <add key="http_proxy" value="http://proxy_hostname_or_ip:3128" />
        <add key="https_proxy" value="http://proxy_hostname_or_ip:3128" />
    </config>

  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>

</configuration> 

In order to test command prompt can be started via PSTools:

psexec -i -s CMD

and actual test run in the newly created cmd windows (runs as Local System):

path_to_nuget\nuget.exe restore "path_to_solution\theSolution.sln"

Go to

Settings ( Global Settings of your PC ) > Network and Internet > Proxy > Automatic Proxy Setup > and set Automatically detect settings to off.


If you see error as follow, you may need to set up your Azure Artifacts Credential, see this Github link, you could either install the credential provider by running a powershell script or manually.

error :   Response status code does not indicate success: 401 (Unauthorized).