How to debug Windows Forms Designer crash?

I have a windows project. It has a main form derived from System::Windows::Forms::Form , which I can open in the designer without any problems. If I try to close the designer, he will kill Visual Studio (v2008 SP1).

The form includes a tab control that has pages with various derived forms System::Windows::Forms::UserControl . Therefore, I assume that the error lies somewhere in the main form or in one of these subcomponents. The problem is that I don’t know how I can narrow it at all?

I tried debugging from another copy of the developer environment, but I cannot get breakpoints to work.

Any suggestions on how to attack this issue would be greatly appreciated!

[EDIT] . As a result of trial and error, I narrowed it down to one System::Windows::Forms::UserControl control, and the crash occurs only when this control is nested in System::Windows::Forms::TabControl . Is there something that the tab control does when it closes, which could lead to a crash?

+4
source share
1 answer

Try opening another VS instance, go to Debug -> attach to process, select another VS from the list (the one in which you have the project), and then set a breakpoint somewhere in your application (somewhere this may cause this error ), and run the project, and you should be able to debug it and find what makes VS failures.

Good luck.

+6
source

All Articles