I have an application that sporadically throws this exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: "Panel".
bei System.Windows.Forms.Control.CreateHandle()
bei System.Windows.Forms.Control.get_Handle()
bei System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
bei System.Windows.Forms.Form.set_Active(Boolean value)
bei System.Windows.Forms.Form.WmActivate(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is there a way to suppress this exception perfectly without touching the code? I am thinking of some kind of registry magic or esoteric .NET configurations.
In addition, I, of course, am also interested in ways to catch this exception. I don't seem to have a hook to catch this exception ... And, of course, this is not reproducible ...
source
share