.net core 升级到.net 5后,dotnet cli无法加载源的服务索引https://api.nuget.org/v3/index.json 由于SSL连接

.net core 升级到.net 5后,dotnet cli无法加载源的服务索引https://api.nuget.org/v3/index.json 由于SSL连接,.net-core,nuget,.net-5,.net Core,Nuget,.net 5,我在Windows10上使用.NETCore3.1。net 5发布后,我立即升级到新版本。我将Visual Studio 2019更新为16.8版。在VisualStudio中一切都运行良好,但当我尝试在dotnet cli中更新dotnet ef时 dotnet工具更新dotnet ef-g 我得到了这个错误: C:\Program Files\dotnet\sdk\5.0.100\NuGet.targets(131,5):错误:无法加载源的服务索引。[C:\Users\z\AppData\L

我在Windows10上使用.NETCore3.1。net 5发布后,我立即升级到新版本。我将Visual Studio 2019更新为16.8版。在VisualStudio中一切都运行良好,但当我尝试在dotnet cli中更新dotnet ef时

dotnet工具更新dotnet ef-g

我得到了这个错误:

C:\Program Files\dotnet\sdk\5.0.100\NuGet.targets(131,5):错误:无法加载源的服务索引。[C:\Users\z\AppData\Local\Temp\eip3wn3x.eys\restore.csproj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.targets(131,5):错误:无法建立SSL连接,请参阅内部异常。[C:\Users\z\AppData\Local\Temp\eip3wn3x.eys\restore.csproj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.targets(131,5):错误:从传输流接收到意外的EOF或0字节。[C:\Users\z\AppData\Local\Temp\eip3wn3x.eys\restore.csproj]

无法还原该工具包。 工具“dotnetsay”安装失败。该故障可能由以下原因引起:

  • 您正在尝试安装预览版本,但未使用--version选项指定版本
  • 找到了一个同名的包,但它不是.NET工具
  • 无法访问所需的NuGet提要,可能是因为Internet连接问题
  • 您输入了错误的工具名称
有关更多原因(包括包命名强制),请访问

我还尝试安装dotnetsay,但出现了相同的错误:

dotnet工具安装dotnetsay-g

在升级到.NET5之前,我能够安装DotnetEF3.1,一切都很好。我猜这个问题可能是由我本地的一个无效证书引起的,但我不确定,我不知道哪个证书用于nuget


非常感谢您的帮助。

我在相同的设置中遇到了相同的问题(win 10,vs 2019 16.8、.net 3.1->.net 5.0)。对我来说,解决方案是设置由指定的注册表值

从该注释复制的解决方案:

将键下的值
Enabled
(Dword)设置为0:
HKEY\U LOCAL\U MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client

提供一个powershell脚本来完成相同的任务