c# - Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException

标签 c# asp.net ssl .net-core iis-express

在第一次运行 ASP.NET Core MVC 样板模板 (DotNet Core) 时,我从 Visual Studio 2017 收到以下关于 SSL 证书的错误消息:

"Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException occurred HResult=0x80070002 Message=The system cannot find the file specified Source=
StackTrace: at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[] rawData, String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at Microsoft.AspNetCore.Hosting.KestrelServerOptionsHttpsExtensions.UseHttps(KestrelServerOptions options, String fileName, String password) ... "

所有其他使用 SSL 的项目都工作正常,我已经仔细检查了我的本地主机证书是否在我本地机器的受信任的根证书颁发机构中并且没有过期。 该项目正在运行 IISExpress - 也许它没有找到正确的位置?我不知道。我哪里出错了?

最佳答案

最近在 ASP.NET Core MVC 样板中遇到了同样的问题。

关闭 Visual Studio,右键单击它,“以管理员身份运行”。为我工作。

关于c# - Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43955181/

相关文章:

c# - 为什么部分方法必须是无效的?

asp.net 用户控件部署

c# - 您可以在没有屏蔽文本框的情况下从 C# 中的文本框输入格式吗?

c# - 如何计算在文本框中输入的字符数?

java - 如何在 wso2product 上将 TLS 1.0 升级到 TLS 1.2

java - 不使用系统属性的带 SSL 的 JMX

sql-server - Visual Studio BI 工具错误

c# - 自动重构访问修饰符

c# - C#的隐藏特性?

c# - 在将字符串添加到 XML 之前对其进行清理吗?