【发布时间】:2010-10-10 10:21:54
【问题描述】:
我已经开始在我的应用程序的几个不同位置看到一个 AccessViolationException。它从未发生在我的开发电脑,我们的测试服务器上。它也只出现在我们的 2 台生产服务器中的 1 台上。因为它似乎只发生在我们的一台生产服务器上,所以我开始查看服务器上安装的 .net 框架版本。
我发现(出于某种奇怪的原因),有问题的生产服务器有 2.0 sp2、3.0 sp2 和 3.5 sp1,而另一台生产服务器和测试服务器有 2.0 sp1。
我的应用程序仅针对 2.0 框架,决定从生产服务器卸载所有框架版本并仅安装 2.0 sp1。到目前为止,我还无法重现该问题。很有意思。
开发电脑:compact 2.0 sp2、compact 3.5、2.0 sp2、3.0 sp2、3.5 sp1
测试服务器:2.0 sp1
生产服务器1:2.0 sp1
生产服务器 2:2.0 sp2、3.0 sp2、3.5 sp1
现在,为什么我无法在具有 2.0 sp2 的开发 PC 上重现该问题,我无法弄清楚。我听说这种访问冲突可能发生在某些使用远程处理的软件上,我的就是这样做的,但是当远程处理实际发生时,访问冲突从未发生过。我现在只使用 2.0 sp1 没问题,但我真的很想知道是否有人遇到过这个问题,以及他们是否找到了新版本框架的解决方法。
以下是一些异常及其堆栈跟踪:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at ICSharpCode.TextEditor.TextArea.HandleKeyPress(Char ch)
at ICSharpCode.TextEditor.TextArea.SimulateKeyPress(Char ch)
at ICSharpCode.TextEditor.TextArea.OnKeyPress(KeyPressEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
【问题讨论】:
-
我唯一一次有 AccessViolationExceptions 是在 Visual Studio .NET 中安装了旧版本的 ahknsvn。除此之外,我没有任何线索......也许该系统上安装了其他东西,例如 PostSharp?
标签: c# .net access-violation servicepacks