System.Security.Cryptography.CryptographicException

在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: 数据保护操作未成功。这可能是由于未为当前线程的用户上下文加载用户配置文件导致的。当线程执行模拟时,可能会出现此情况。

解决方法:
1.打开IIS应用程序池
2.在应用程序上右键选择高级设置
3.进程模型下设置“加载用户配置文件”为True

posted @ 2017-05-26 16:00  钱恩基  阅读(449)  评论(0编辑  收藏  举报