I began to see that AccessViolationException throws several different points in my application. This never happened on my development computer, our test server. It also appeared on only one of our 2 production servers. Since it only seemed on one of our production servers, I started looking at the installed versions of .net on the servers.
I found that (for some strange reason), the production server that was having problems had 2.0 sp2, 3.0 sp2 and 3.5 sp1, while the other production server and the test server had 2.0 sp1.
My application is intended only for framework 2.0, I decided to remove all versions of the framework from the production server and install only 2.0 sp1. So far, I have not been able to reproduce the problem. Very interesting.
PC development: compact 2.0 sp2, compact 3.5, 2.0 sp2, 3.0 sp2, 3.5 sp1 Control server: 2.0 sp1 Production server1: 2.0 sp1 Production server2: 2.0 sp2, 3.0 sp2, 3.5 sp1
Now, why I cannot reproduce the problem on my development computer with 2.0 sp2, I cannot understand. I heard rumors that this violation of access rights can occur on some software that uses remote access, which does, but violation of access rights never occurs when the switch actually takes place. I am fine using only 2.0 sp1, but I'm really interested to know if anyone had this problem and if they found a workaround for newer versions of the frame.
Here are a couple of exceptions and their stack trace:
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)
Jeremy Feb 27 '09 at 20:07 2009-02-27 20:07
source share