InvalidOperationException:使用 cermgr 安装的证书在 AspNetCore 上未指定密钥类型

InvalidOperationException: Key type not specified on AspNetCore using cermgr installed certificate

我正在尝试将使用 IdentityServer4 的 AspNetCore 应用程序部署到 IIS,当我启动它时,我收到 InvalidOperationException: Key type not specified 错误。我使用 MMC 加载 certmgr 并导入了我使用密码创建的自签名证书,但它不起作用。有什么想法吗?

我自己也遇到了这个问题。我的解决方法是返回到 certmgr 并右键单击证书,然后单击所有任务,然后管理私钥,然后添加 IIS_IUSRS。根据为您的网站配置 IIS 应用程序池的方式,您可能还必须添加用户“IIS APPPool{apppoolname}”。对于非常旧的或配置错误的 IIS 设置,可能是本地服务 and/or 网络服务。