System.Security.Cryptography.CryptographicException: 拒绝访问。

今天部署一个Abp web应用,访问站点异常,提示“System.Security.Cryptography.CryptographicException: 拒绝访问。”,中文网络上给的解决方案是:

C:\Documents and Settings\All Users\Application Data
添加项目应用程序池对应启动帐号(或iis_wpg组) 读取,读取并运行,列出文件夹目录权限。
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys
添加项目应用程序池对应启动帐号(或iis_wpg组)除完全控制和特殊权限以外的所有权限。

这种方法有一定的安全风险,我自己摸索了一个解决方法,同时在MSDN上有人给出相同的解决方案:

  1. the account under which the respective application pool of the virtual directory that you create is running should be added in to CryptoGraphic Operator user.
  1. Open IIS7 --> ApplicationPools --> YourAppPool -->RighClikck --> Advanced Settings ---> Load User Profile set this value to true.

经过验证,这是有效的。

posted on 2023-12-11 11:03  杜冠魁  阅读(103)  评论(0编辑  收藏  举报