本文介绍了Commerce Server 2009中的System.AccessViolationException r2:尝试读取或写入受保护的内存。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 当我们访问Microsoft Commerce Server 2009 r2 x64网站时,收到以下错误消息: "尝试读取或写入受保护的内存。这通常表明其他内存已损坏。" TargetSite:Microsoft.CommerceServer.Runtime.Profiles.ProfileContext 当我们创建配置文件运行时上下文时抛出上述异常。 我们在Microsoft支持网站上发现了针对上述问题的Hot Fix, 网址: http://support.microsoft.com/kb/977980 可用修订名称:CS2007SP2_KB977980,CS2009RTM_KB977980 。 但热修复仅适用于Commerce Server 2007,而不适用于2009 r2。 任何人都可以建议解决这个问题吗? 谢谢, Anandan M 解决方案 当CLR正在清理时,在完成阶段的进程关闭期间,托管应用程序可能会崩溃。  如果应用程序通过COM-Interop使用本机代码或平台调用Library,则会发生这种情况。  在对象上调用Finalization 时,需要运行该对象的代码来清理内存,但如果已卸载包含代码的dll,则进程将崩溃,因为它无法使该代码完善。  在这种情况下会抛出访问冲突异常。 我的建议是安装补丁,重置IIS并测试错误是否可重现。  ; Hi,When we access a Microsoft Commerce Server 2009 r2 x64 web site, we receive the following error message:"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."TargetSite : Microsoft.CommerceServer.Runtime.Profiles.ProfileContextThe above exception thrown when we create a profile run time context.We found a Hot fix in the Microsoft-support site for the above issue, URL :http://support.microsoft.com/kb/977980Available Fix names: CS2007SP2_KB977980, CS2009RTM_KB977980.But the hot fix only suit for Commerce Server 2007, not for 2009 r2. can anyone suggest to address this issue?Thanks,Anandan M 解决方案 A managed application may crash during process shut down in the finalization stage when the CLR is cleaning up.  This will happen if the application is using native code through COM-Interop or a platform invoke call to Library.  When Finalization is called on an object, the code for that object needs to run to clean up memory, but if the dll containing the code has been unloaded, the process will crash as it cannot fine that code.  An Access Violation exception will be thrown in such cases.My recommendation is to install the patch, do IIS reset and test whether the error is reproducible.  这篇关于Commerce Server 2009中的System.AccessViolationException r2:尝试读取或写入受保护的内存。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 22:19