【问题标题】:HTTP Error 500.30 (Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: The system cannot find the file specified.)HTTP 错误 500.30(Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException:系统找不到指定的文件。)
【发布时间】:2020-07-22 21:35:55
【问题描述】:

我正在尝试将 asp.net 核心 Web API 部署到 IIS。这个应用程序在 Visual Studio 上运行得非常好,当我使用 dotnet 命令运行 dll 时也是如此。此应用程序具有用于签署 JWT 令牌的证书。将应用程序部署到 IIS 后,我收到“HTTP Error 500.30 - ANCM In-Process Start Failure”,我检查了 Windows 日志,错误消息是

主机意外终止。 Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: 系统找不到指定的文件。在 Internal.Cryptography.Pal.CertificatePal.FilterPFXStore(Byte[] rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags)......

我检查了文件路径和文件名,一切都正确,但由于某些原因 IIS 无法加载找到证书文件。另外,我检查了许可,它看起来也不错。不知道为什么我会收到此错误消息

此外,我使用 IIS 指向的 dotnet run 命令运行了相同的应用程序 dll 文件,但我没有收到任何错误。我只有在部署到 IIS 后才会收到此错误。

关于 startup.cs 文件和配置方法,我在这一行出现错误。

var cert = new X509Certificate2("test_cert.pfx", pwdFrmVault);

【问题讨论】:

    标签: asp.net-core iis


    【解决方案1】:

    在搜索此错误并进行谷歌搜索后,此解决方案对我有用。 IIS管理器->应用程序池->高级设置->在进程模型下,将用户配置文件加载为true。更多详情link

    【讨论】:

    • 如果您能接受您的解决方案作为答案,我们将不胜感激。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-07
    • 2016-09-19
    • 2012-03-02
    • 2011-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多