I've got a control that crashes on the form designer when I build the application, and am trying to figure out how to debug the problem.
I thought all I needed to do to be able to get in with a debugger was to start a second copy of VS and use Debug-Attach to process and attach to the copy of visual studio that the solution with my troublesome control is in. I did that but nothing is happening when the control crashes so I know I'm doing something wrong...
The crash occurs in the designer and returns the messagebox:
---------------------------
Microsoft Visual Studio
---------------------------
The control NameSpace.MyControl has thrown an unhandled exception in the designer and has been disabled.
Exception:
Could not load file or assembly 'OtherProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Stack trace:
at NameSpace.MyControl.OnPaint(PaintEventArgs e)
---------------------------
OK
---------------------------
OtherProject is part of the solution and is referenced by the project with both the form and the custom control in it.
When I dismiss the messagebox the control shows a stacktrace where the control is on my form, but since it doesn't include line numbers I don't know where the problem is coming from.