visual-studio-2019 - VS 2019 发布问题 - 无法加载源 https://api.nuget.org/v3/index.json 的服务索引
问题描述
当我尝试发布特定解决方案时遇到问题。
相关:
- 我已经能够发布/部署大约 6 个没有问题的解决方案。
- 当我尝试发布时给我带来问题的解决方案在我的本地 VS 2019 上运行 100%,问题是发布
- 这是我在 VS 2019 上从新创建的第一个解决方案。所有其他解决方案都是在 VS 2017 上创建的
- 我可以在浏览器中运行 - https://api.nuget.org/v3/index.json
- 我确实尝试过运行 NuGet 包还原
- 我确实尝试实施我在研究时发现的不同解决方案
如果你谷歌搜索“请求被中止:无法创建 SSL/TLS 安全通道”的错误,你会看到很多文章。我尝试了详细的解决方案,显然没有运气。
...
1>------ Publish started: Project: HFSPackagesApi, Configuration: Release Any CPU ------
Connecting to C:\deployments\HFSPackagesApi...
Determining projects to restore...
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(128,5): Error : Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel.
C:\Program Files\dotnet\sdk\3.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1004: Assets file 'F:\source\BitBucket\gmborl\LiveBackup\ReleaseInsightApp\HFSPackagesApi\HFSPackagesApi\obj\publish\win-x64\project.assets.json' not found. Run a NuGet package restore to generate this file.
1>Build failed. Check the Output window for more details.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
...
解决方案
通过执行支持文章中概述的以下步骤在 Windows 7 中修复它:
步骤1
添加一个名为 to的DWORD
注册表项:DefaultSecureProtocols
0x00000a00
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp
注意:Wow6432Node
仅在 64 位 Windows 上需要第二个 (in )。
第2步
创建子键:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client
在它们中的每一个中添加一个DWORD
名为的条目DisabledByDefault
,其值为0
。
注意:您可能需要创建TLS 1.x
密钥和Client
密钥。
推荐阅读
- django - 如何翻译 django-allauth 模板?
- mysql - 构建 Docker mysql 数据库后抛出 OperationalError
- java - 如何设计一个系统来根据电子邮件中的链接对用户进行身份验证
- c# - C# 错误:控制不能从一个 case label('case0:') 到另一个 case label('case0:')
- windows - 在命令提示符/Windows Powershell (Windows 10) 中使用 UTF-8 编码 (CHCP 65001)
- android - android中webView中的ERR_ACCESS_DENIED
- python - 为什么基于 fft 的卷积总是比空间卷积运行得慢?
- python-3.x - 如何从 mysql 数据库和树视图中删除 python ttk 树视图上的选定项目?
- ssl - 如何为指向另一个服务器 IP 地址的记录子域设置 SSL 证书
- vb.net - 我希望我的自定义类将日志事件传递给调用者 vb.net