这实际上不是一个重复这个问题 https://stackoverflow.com/questions/41185443/nuget-connection-attempt-failed-unable-to-load-the-service-index-for-source因为提供的答案不起作用,而我使用 Bootcamp 在 MacBook 上使用 Windows-7.
我在尝试在 Nuget 包管理器中搜索任何包时收到以下错误:
严重性代码 说明 项目文件行抑制状态
错误 [nuget.org] 无法加载源的服务索引https://api.nuget.org/v3/index.json https://api.nuget.org/v3/index.json。
发送请求时发生错误。
基础连接已关闭:发送时发生意外错误。
无法从传输连接读取数据:现有连接被远程主机强制关闭。
现有连接被远程主机强制关闭
我的 NuGet 配置文件(%appdata%/nuget
):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Nuget.org 开始强制使用 TLS 1.2(并放弃了对 TLS 1.1 和 1.0 的支持)。检查下面的 DisabledByDefault 值,
注册表中的 HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client。
要启用支持,请确保您已安装更新并打开支持:
reg add "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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)