5
votes

This is my NuGet.config :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <packageSources>
      <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
   </packageSources>
   <disabledPackageSources>
      <add key="Microsoft and .NET" value="true" />
   </disabledPackageSources>
</configuration>

Now, in Visual Studio, when I try to install 'geckofx45' package, I get the following error :

install-package geckofx45 install-package : Unable to load the service index for source https://api.nuget.org/v3/index.json. At line:1 char:1 + install-package geckofx45 + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Do you have any solutions ?

Thank you in advance

3
how about this issue now? Could you install any nuget package? If not, please let me know the latest status of this issue, and what have you tried.Leo Liu-MSFT
It's resolved. In Visual Studio, 'Tools' >> 'Options' >> 'NuGet Package Manager' >> 'Package Sources', I disactivated 'nuget.org' and 'microsoftdotnet' and I deed in console mode install-package geckofx45.nupkg and it worksuser2274060
Glad to know you have resolved this issue, could you please convert your comment to the answer? This can be beneficial to other community members reading this thread and easily find the answer. Thanks. :).Leo Liu-MSFT

3 Answers

13
votes

Visual Studio - Nuget - Unable to load the service index for source

This is a common error, we could not get much useful info from this error message. We could only provide the troubleshootings for this issue.

The reason for this issue in most cases is because the network issue or the incorrect configuration in the nuget.config.

In order to make sure that whether this issue is related to the VS IDE, the network or others, first, please open the path of the nuget server https://api.nuget.org/v3/index.json in the browser. If you can open it in the browser, this issue probably more related to the VS IDE/nuget.config. You can delete nuget.config in the %appdata%\Nuget, then restart the Visual Studio to generate the new nuget.config.

Second, if you also could not open it in the browser, this issue probably related to the network issue, you should check if you have proxy variable http_proxy in our system variables or in the IE browser, we could test it on another PC with same network. if you have the proxy settings in your PC, you can remove it to test it or you can add proxy settings into Nuget.Config file. Refer to this link for details: Nuget Config Section & Nuget Proxy Settings. After we confirm we do not have any proxy in our PC, then we should to check if our network is limited. We could test it with a different net work.

See the same issue for some more details.

0
votes
nuget restore 

and

msbuild /t:restore

both didn't work for me. But

dotnet restore 

worked perfect. Try that

0
votes

Tested on Windows 7

Step1 : Open Command window (run cmd) Step 2: Run the following commands to enable TLS 1.2 support if it is disabled (adding REGISTRY Entries):

"HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:32 reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:64 reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v Enabled /t REG_DWORD /d 1 /f /reg:32 reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v Enabled /t REG_DWORD /d 1 /f /reg:64