zoukankan      html  css  js  c++  java
  • 部署时,出现用户代码未处理 System.Security.Cryptography.CryptographicException 错误解决方法

    在调用RSA加密的.pfx密钥时,在本地调试没有问题,可以布署到服务器,就会报以下的错误:

    复制代码
    用户代码未处理 System.Security.Cryptography.CryptographicException
      HResult=-2146893792
      Message=出现了内部错误。
    
      Source=mscorlib
      StackTrace:
           在 System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
           在 System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
           在 System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
           在 System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
           在 xxxxx.API.Tools.RSA.Sign(String data, String keyPath, String keyPasswd)
           在 xxxxx.API.Tools.Encrypt.signANDencrypt(MsgBean req_bean)
           在 xxxxx.API.xxxxx.GetBankCardInfo(String orderId, String cardNo)
           在 xxxxx.GetBankCardInfo(GetBankCardInfoReq request) 位置 d:app_serviceWHTR_SOAWHTR.SOA.ServicesOnlinePayYilianOnlinePayService.cs:行号 108
           在 Castle.Proxies.Invocations.xxxxx.InvokeMethodOnTarget()
           在 Castle.DynamicProxy.AbstractInvocation.Proceed()
           在 xxxxx.CastleMethodInvocation.Proceed() 位置 d:xxxxx.cs:行号 80
           在 xxxxx.Intercept(IMethodInvocation invocation) 位置 d:xxxxx.cs:行号 56
      InnerException: 
    复制代码

    处理方法:

    IIS 应用程序池--选中你网站的所配置的应用程序池--右键 选择 “高级配置” --将“加载用户配置文件” 设置为True 。问题解决

  • 相关阅读:
    关于工作流程引擎中的岗位的设置的问题
    将要发布的开源CCOA的照片一览
    关于多个checkbox在IE6下自由表单设计器中的兼容问题
    ccflow流程自动发起功能增加,如何按指定的时间触发方式发起流程?
    Windows 如何远程强行关机
    Report bulder
    微软sample and code down web address
    如何查看sql server的死锁情况
    如何读取数据的所有用户表
    复制和数据库镜像
  • 原文地址:https://www.cnblogs.com/Alex80/p/8555188.html
Copyright © 2011-2022 走看看