VS2022 17.14离线安装时提示Unable to verify the certificate解决方法

1、通过以下命令创建离线安装包

vs_Community.exe --layout D:\VS2022\Offline --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --includeOptional --lang zh-CN

2、通过以下命令进行安装

d:\Offline\vs_Community.exe --noWeb --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --includeOptional --lang zh-CN

安装过程中出现闪退现象,查询%temp%文件夹中安装日志,发现

[0568:0003][2025-07-10T22:15:48] Using Offline package: D:\Offline\vs_installer.opc

[0568:0003][2025-07-10T22:15:48] Saving Certificates to layout folder

[0568:0003][2025-07-10T22:15:49] Certificate is invalid: D:\Offline\vs_installer.opc

[0568:0003][2025-07-10T22:15:49] Error: Unable to verify the certificate: InvalidCertificate

[0568:0003][2025-07-10T22:15:49] Error 0x80131509: Signature verification failed. Error: Unable to verify the integrity of the installation files: the certificate could not be verified. 在 Microsoft.VisualStudio.Setup.OpcVerifier.Verify(Stream packageStream, String layoutLocation, Boolean skipSavingCertificate) 在 Microsoft.VisualStudio.Setup.Bootstrapper.Bootstrapper.VerifyLayoutPackage(Stream packageStream)

[0568:0003][2025-07-10T22:15:49] Bootstrapper failed with known error.

 

经过网上各种搜索,找到解决方案如下:下载以下证书,并安装证书到“受信任的根证书颁发机构”

http://www.microsoft.com/pkiops/certs/Microsoft Windows Code Signing PCA 2024.crt

 

原始来源:

Visual Studio Professional 17.14.7 installer fails due to certificate validation error, even though certificates were installed - Developer Community

posted @ 2025-07-10 22:40  Aeru  阅读(543)  评论(1)    收藏  举报