You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ASP.NET Core仓库v3.0.0-preview8版本NuGet包还原失败求助

解决dotnet restore SSL证书错误问题

操作步骤

执行以下命令克隆代码并切换指定分支:

git clone https://github.com/dotnet/aspnetcore.git
git checkout v3.0.0-preview8.19405.7

导航至src\Mvc目录后执行还原命令:

dotnet restore

触发的错误信息

C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\NuGet.targets(123,5): 错误: 无法加载源 https://dotnet.myget.org/F/roslyn/api/v3/index.json 的服务索引。[D:\aspnetcore\src\Mvc\Mvc.sln]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\NuGet.targets(123,5): 错误: 无法建立SSL连接,请查看内部异常。[D:\aspnetcore\src\Mvc\Mvc.sln]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\NuGet.targets(123,5): 错误: 根据验证过程,远程证书无效。[D:\aspnetcore\src\Mvc\Mvc.sln]

可行解决方案

  • 检查本地系统根证书状态,手动安装dotnet.myget.org的SSL证书
  • 临时绕过SSL验证执行还原(仅用于测试场景,不建议生产环境使用):
    dotnet restore --disable-parallel --no-cache -s https://api.nuget.org/v3/index.json
    
  • 升级dotnet SDK至稳定版本,预览版SDK可能存在证书兼容性问题

内容的提问来源于stack exchange,提问作者Prog

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 17:33:27