我们可以将 WEBSITE_LOAD_USER_PROFILE=1 添加到 web.config

Can we add WEBSITE_LOAD_USER_PROFILE=1 to web.config

我遇到 CryptographicException:系统找不到指定的文件 当应用程序托管在使用证书的 Azure 上时出现错误?现在我所看到的是,如果我们使用 azure 应用程序服务,我们必须将 WEBSITE_LOAD_USER_PROFILE=1 添加到 azure 的应用程序设置中。但是如果我们不使用应用服务,我们如何实现呢

不,你不能。

即使您使用 IIS 7,您的选择是在 IIS 应用程序池配置中将 Load User Profile 选项设置为 True,您无法在 Web 配置文件中设置它。如果你使用其他的云服务,我想也应该有像WEBSITE_LOAD_USER_PROFILE in azure这样的设置。

更多详情,您可以参考以下链接。

  1. X509Certificate Constructor Exception

  2. What exactly happens when I set LoadUserProfile of IIS pool

  3. Can I set application pool in webconfig