首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

WebServices初始化报错:System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。该怎么

2012-09-10 
WebServices初始化报错:System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内

WebServices初始化报错:System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。

请各路高手走过路过,给指教一下!

调用WebServices,

 SPCControllerWS.SPCSrvWS spcws = new SPCUDRVExt.SPCControllerWS.SPCSrvWS();

出现以下错误:


System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
  在 System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
  在 System.Signature..ctor(RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
  在 System.Reflection.RuntimeMethodInfo.get_Signature()
  在 System.Reflection.RuntimeMethodInfo.get_ReturnType()
  在 System.Web.Services.Protocols.LogicalMethodInfo.IsBeginMethod(MethodInfo methodInfo)
  在 System.Web.Services.Protocols.LogicalMethodInfo.Create(MethodInfo[] methodInfos, LogicalMethodTypes types, Hashtable declarations)
  在 System.Web.Services.Protocols.SoapClientType.GenerateXmlMappings(Type type, ArrayList soapMethodList, String serviceNamespace, Boolean serviceDefaultIsEncoded, ArrayList mappings)
  在 System.Web.Services.Protocols.SoapClientType..ctor(Type type)
  在 System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
  在 SPCUDRVExt.SPCControllerWS.SPCSrvWS..ctor()
  在 SPCUDRVExt.SPCUDRVExtForm.SPCUDRVExtForm_Load(Object sender, EventArgs e)


[解决办法]
这不是Webservice的问题,而是可能你调用非托管DLL引发的问题。

._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)

[解决办法]
这个问题比较奇怪,感觉系统或者.net runtime坏了似的。

热点排行