Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException [英] Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException

查看:30
本文介绍了Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm getting the following error message from Visual Studio 2017 on first run of the ASP.NET Core MVC Boilerplate template (DotNet Core) regarding the SSL certificate:

"Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException发生 HResult=0x80070002 Message=系统找不到文件指定源=
堆栈跟踪:在Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[]rawData、字符串文件名、字符串密码、X509KeyStorageFlagskeyStorageFlags) 在System.Security.Cryptography.X509Certificates.X509Certificate..ctor(字符串文件名、字符串密码、X509KeyStorageFlags keyStorageFlags) 在Microsoft.AspNetCore.Hosting.KestrelServerOptionsHttpsExtensions.UseHttps(KestrelServerOptions选项,字符串文件名,字符串密码) ... "

"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 的项目都可以正常工作,我已经仔细检查了我的 localhost 证书是否在我本地机器的受信任的根证书颁发机构中并且没有过期.该项目正在运行 IISExpress - 也许它看起来不正确?我不知道.知道我哪里出错了吗?

All other projects using SSL work fine and I've double checked that my localhost certificate is in the Trusted Root Certification Authorities for my local machine and has not expired. The project is running IISExpress - perhaps it's not looking the correct place? I'm not sure. Any ideas where I'm going wrong?

推荐答案

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

Recently had this same issue with ASP.NET Core MVC Boilerplate.

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

Close Visual Studio, right click on it, "Run as Administrator". Worked for me.

这篇关于Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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