gpt4 book ai didi

c# - 在 Visual Studio 2022 中运行我的 Blazor 应用程序时出现错误 "Failed trusting the certificate"

转载 作者:行者123 更新时间:2023-12-05 03:32:29 24 4
gpt4 key购买 nike

我安装了 Visual Studio 2022 并创建了一个 Blazor Web 程序集项目。当我启动应用程序时,Visual Studio 2022 提示信任 ASP.NET Core 生成的自签名证书。请引用下面的屏幕截图:

enter image description here

在我点击"is"之后,它生成了错误“无法信任证书”,如下面的屏幕截图所示:

enter image description here

请帮助我修复错误。我也尝试了以下命令,但它没有解决我的问题:

dotnet dev-certs https --trust

注意:Visual Studio 2019 也安装在我的机器上,即目前我的机器上同时安装了 VS2019 和 VS2022。

最佳答案

我终于能够解决这个问题,我提到了解决我的问题的步骤。它可能对某人有益:

第 1 步:通过在 Windows 搜索栏中搜索打开“管理用户证书”,然后从“个人 -> 证书”中删除本地主机证书: enter image description here

第 2 步:现在从“受信任的根证书颁发机构 -> 证书”中找到并删除本地主机证书: enter image description here

第 3 步: 打开“管理计算机证书”并从“个人”和“受信任的根证书颁发机构”中删除本地主机: enter image description here

第 4 步:以管理模式启动 Visual Studio 并运行您的应用程序。如果提示信任自签名证书,请单击是: enter image description here

第 5 步:现在再次打开“管理用户证书”并在选择本地主机后单击“导出”: enter image description here

第 6 步: 单击“下一步”按钮: enter image description here

第 7 步:选择“DER 编码二进制 X.509(.CER)”并单击下一步: enter image description here

第 8 步: 将名为“localhost.cer”的文件保存到桌面 enter image description here

第 9 步:现在双击您刚刚在第 8 步中保存的 localhost.cer 文件以安装证书。 enter image description here

第 10 步:为“本地计算机”安装证书: enter image description here

第 11 步:选择“将所有证书放入以下存储区”选项,然后单击浏览按钮浏览证书存储区。然后选择“受信任的根证书颁发机构” enter image description here

第 12 步:重复第 9 步到第 11 步,但这次为“当前用户”安装它,并将其安装在“受信任的发布者”证书存储中。 enter image description here

第 13 步:重新启动 Visual Studio 并重新运行您的应用程序,希望它能解决您的问题。

关于c# - 在 Visual Studio 2022 中运行我的 Blazor 应用程序时出现错误 "Failed trusting the certificate",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70473358/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com