I am randomly getting this error while debugging in visual studio 2010.
The app makes some querys to a mysql db, then processes it and generates a excel output. The error happens while the data is being processed, but sometimes it works flawlessly and sometimes it crashes, while using the exact same data sample.
If I run the application without debugging it, I sometimes get the following exception, sometimes I get a "application stopped working" and sometimes it works flawlessly. Same happens when I install the app on another PC.
************** Texto de la excepción **************
System.Threading.ThreadAbortException: Subproceso anulado.
en System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
en System.Internal.HandleCollector.HandleType.Add(IntPtr handle)
en System.Windows.Forms.UnsafeNativeMethods.CreateDC(String lpszDriver)
en System.Windows.Forms.Screen..ctor(IntPtr monitor, IntPtr hdc)
en System.Windows.Forms.Screen.FromPoint(Point point)
en System.Windows.Forms.Form.FillInCreateParamsStartPosition(CreateParams cp)
en System.Windows.Forms.Form.get_CreateParams()
en System.Windows.Forms.Control.SizeFromClientSize(Int32 width, Int32 height)
en System.Windows.Forms.Control.SizeFromClientSize(Size clientSize)
en System.Windows.Forms.ContainerControl.GetPreferredSizeCore(Size proposedSize)
en System.Windows.Forms.Form.GetPreferredSizeCore(Size proposedSize)
en System.Windows.Forms.Control.GetPreferredSize(Size proposedSize)
en System.Windows.Forms.Control.get_PreferredSize()
en System.Windows.Forms.Form.OnLayout(LayoutEventArgs levent)
en System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
en System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
en System.Windows.Forms.Control.OnResize(EventArgs e)
en System.Windows.Forms.Form.OnResize(EventArgs e)
en System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
en System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
en System.Windows.Forms.Control.UpdateBounds()
en System.Windows.Forms.Control.WmCreate(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
en System.Windows.Forms.Form.WmCreate(Message& m)
en System.Windows.Forms.Form.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I don't understand why I get this exception, why the debugger doesn't handle or stop when this exception occurs while debugging (or why this exception doesn't raise while debugging) or what is causing vshost32.exe to stop working while debugging.
I have tried changing target CPU to 32 bits or AnyCPU but nothing changes. I'm not sure what else should I add to explain my problem, if you need more info just ask me
Thank you very much!