在第一次运行 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/