且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio 2017 给出“将证书添加到受信任的根证书存储失败并出现以下错误"

更新时间:2023-11-24 17:18:46

注意:从问题中添加 OP 的解决方案作为答案.

这对我有用.删除了所有本地主机证书.在添加/删除程序中运行修复 IIS Express.将 localhost 证书从 Personal/Certificate 复制并粘贴到 Trusted Root Certificates,它不再抱怨了.

This is what worked for me. deleted all localhost certificates. ran repair IIS Express in Add/Remove Programs. Copy and pasted localhost certificate from Personal/Certificate to Trusted Root Certificates and it didn't complain anymore.

修复/重新安装 IIS Express 似乎并没有真正解决这个问题(从 IIS Express 10 开始),真正的解决方案是将 localhost 证书添加到 Trusted Rood 证书.

Repairing/reinstalling IIS Express does not appear to actually fix this issue (as of IIS Express 10), the real solution is to add the localhost certificate to Trusted Rood Certificates.

此博客文章涵盖了如何执行此操作的完整详细信息:https://blogs.iis.net/robert_mcmurray/how-to-trust-the-iis-express-self-signed-certificate

Full details for how to do this is covered by this blog post: https://blogs.iis.net/robert_mcmurray/how-to-trust-the-iis-express-self-signed-certificate

总之,

  • 通过控制面板中的管理计算机证书"或在 cmd 提示符下运行 certlm 打开证书管理器
  • 在 Personal>Certificates 下导出 localhost 证书并将其保存到磁盘
    • 不要导出私钥!只需导出公钥.