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

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

System.Security.Cryptography.CryptographicException的更多相关文章

  1. "System.Security.Cryptography.CryptographicException: 拒绝访问" 问题的解决方法

    .net web程序使用rsa算法进行加解密时,程序报告“System.Security.Cryptography.CryptographicException: 拒绝访问”错.按网上搜的解决方法做了 ...

  2. System.Security.Cryptography.CryptographicException: 指定了无效的提供程序类型

    这两天在调用银联在线的支付接口,把银联提供的demo代码copy过来放到自己网站上,生成通过了,但是运行的时候就报错了: 指定了无效的提供程序类型. 说明: 执行当前 Web 请求期间,出现未经处理的 ...

  3. System.Security.Cryptography.CryptographicException 出现了内部错误

    调试微信支付退款时,需要使用pfx证书,在本地调试时没有问题,但在服务器部署时报异常:System.Security.Cryptography.CryptographicException 出现了内部 ...

  4. 部署时,出现用户代码未处理 System.Security.Cryptography.CryptographicException 错误解决方法

    转载:http://www.cnblogs.com/jys509/p/4499978.html 在调用RSA加密的.pfx密钥时,在本地调试没有问题,可以布署到服务器,就会报以下的错误: 用户代码未处 ...

  5. 使用证书部署出现System.Security.Cryptography.CryptographicException 错误解决方案

    一.System.Security.Cryptography.CryptographicException: 找不到对象 at System.Security.Cryptography.Cryptog ...

  6. WCF:System.Security.Cryptography.CryptographicException: 密钥集不存在

    WCF使用IIS部署时,使用x509证书验证,在创建证书并正确配置程序后,访问出现错误提示: System.Security.Cryptography.CryptographicException: ...

  7. WebApi 数据保护操作未成功。这可能是由于未为当前线程的用户上下文加载用户配置文件导致的。当线程执行模拟时,可能会出现此情况。","ExceptionType":"System.Security.Cryptography.CryptographicException","StackTrace

    在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...

  8. 调用微信退款接口或发红包接口时出现System.Security.Cryptography.CryptographicException: 出现了内部错误 解决办法

    我总结了一下出现证书无法加载的原因有以下三个 1.证书密码不正确,微信证书密码就是商户号 解决办法:请检查证书密码是不是和商户号一致 2.IIS设置错误,未加载用户配置文件 解决办法:找到网站使用的应 ...

  9. System.Security.Cryptography.CryptographicException,密钥集不存在

    非常感谢,已经解决了.是当前用户没有权限访问证书的私钥文件的问题,之前尝试去解决,但是在对:C:\Documents and Settings\All Users\Application Data\M ...

随机推荐

  1. Android开发笔记 TableLayout常用的属性介绍

    今天看了安卓简单控件的布局方式,大概有绝对.相对.表格.线性.帧式布局五种方式,表格布局里面的一些属性相对来说比较复杂,下面主要谈谈表格方式布局的一些属性   TableLayout经常用到的属性有: ...

  2. leetcode421

    public class Solution { public int FindMaximumXOR(int[] nums) { , mask = ; ; i >= ; i--) { mask = ...

  3. Apple Ad Hoc

    Apple Ad Hoc 发布测试 App只能通过Ad Hoc分享给绑定我们账号的设备上,所以至是一百台 1.官网member Center创建Ad Hoc证书 2.在官网下载Ad Hoc证书到mac ...

  4. 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 4_Linear Regression with Multiple Variables 多变量线性回归

    Lecture 4 Linear Regression with Multiple Variables 多变量线性回归 4.1 多维特征 Multiple Features4.2 多变量梯度下降 Gr ...

  5. Dubbo简单介绍及其和zookeeper的关系

    何为Dubbo ​ Dubbox 是一个分布式服务框架,其前身是阿里巴巴开源项目Dubbo ,被国内电商及互联网项目中使用,后期阿里巴巴停止了该项目的维护,当当网便在Dubbo基础上进行优化,并继续维 ...

  6. 数据结构》关于差分约束的两三事(BZOJ2330)

    差分约束,主要用来解决数学中的线性规划问题,通过差值与两个未知数可以转化为单源最长路问题(或负值最短路). 当有一个式子为x1-x2>=a时,我们可以建边,这条边设定为x1比x2大等a(或x2比 ...

  7. 【bzoj2818】Gcd

    2818: Gcd Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 4344  Solved: 1912[Submit][Status][Discuss ...

  8. php opcode

    opcode是计算机指令中的一部分,用于指定要执行的操作, 指令的格式和规范由处理器的指令规范指定. 除了指令本身以外通常还有指令所需要的操作数,可能有的指令不需要显式的操作数. 这些操作数可能是寄存 ...

  9. commons-X系列

    1 commons-lang 1.1 ReflectionToStringBuilder 将对象进行字符串拼接 /* * Licensed to the Apache Software Foundat ...

  10. Tensorflow学习(练习)—使用inception做图像识别

    import osimport tensorflow as tfimport numpy as npimport re from PIL import Imageimport matplotlib.p ...