Visual Studio 2017 给出“将证书添加到受信任的根证书存储失败并出现以下错误" [英] Visual Studio 2017 gives 'Adding the Certificate to The Trusted Root Certificates store failed with the following Errror'

查看:24
本文介绍了Visual Studio 2017 给出“将证书添加到受信任的根证书存储失败并出现以下错误"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 SSL 模式设置为 true 的情况下运行 ASP MVC 应用程序,每当我运行该应用程序时,都会提示我信任 IIS Express SSL 证书.单击是时,它会给出错误消息将证书添加到受信任的根证书存储失败,并出现以下错误.访问被拒绝'.我以管理员模式运行我的 Visual Studio 2017.我还通过 MMC 删除了 localhost 证书.有没有其他人遇到过这个问题.

I am trying to run ASP MVC application with SSL mode set to true and whenever i run the application, i get prompt to trust the IIS Express SSL certificate. Upon clicking Yes, it gives the error message 'Adding the Certificate to The Trusted Root Certificates store failed with the following Errror. Access is denied'. I am running my Visual Studio 2017 as administrator mode. I have also deleted localhost certificate by going to MMC. Has anyone else run into this issue.

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

SOLN: 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.

推荐答案

注意:从问题中添加 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 证书并将其保存到磁盘
    • 不要导出私钥!只需导出公钥.

    这篇关于Visual Studio 2017 给出“将证书添加到受信任的根证书存储失败并出现以下错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆