In my C # .net winform application, the following exception appears.
A common mistake in GDI +.
in System.Drawing.Graphics.CheckErrorStatus (status Int32)
in System.Drawing.Graphics.DrawRectangle (Pen, Int32 x, Int32 y, Int32 width, Int32 height)
in WeifenLuo.WinFormsUI.Docking.DockWindow.OnPaint (PaintEventArgs e)
in System.Windows.Forms.Control.PaintWithErrorHandling (PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
in System.Windows.Forms.Control.WmPaint (Message & m)
in System.Windows.Forms.Control.WndProc (Message & m)
in System.Windows.Forms.ScrollableControl.WndProc (Message & m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage (Message & m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc (Message & m)
in System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The most confusing point is that it is very rare when an application loading a form (which contains some rich graphics, WPF work, etc.) can tell about 90% of the time when the form is loaded successfully. but very few times when this happens is reproduced, and also only on some machines, on some other machines, this form works in 100% of cases and never encounters this exception.
I donβt understand why this is happening, because it also does not show the exact stack trace that throws an exception. Please suggest if you have an idea of ββhow to deal with this.
source share