Visual Studio Designer Crashes

Just a little note to myself and maybe some other guys out there with the same problem.

Flaming truck

When the Visual Studio 2008 / 2010 designer shows you the forms and controls, it executes certain code to show them to you. When it crashes, you should look on which form it crashed and then inspect this form very closely, including all their fields.

The error can be in the constructor of the form, in the constructor of the custom controls you’re using and in the OnPaint() events of either forms and controls. Make sure you’re either encapsulating all these with try-catch-blocks so you can at least track down the problem and not have Visual Studio crash on you each time you try.

(If you know other sources of VS designer crashes, please post a comment)
Creative Commons License photo credit: selva

, Posted Wednesday, October 20th, 2010 under Privat.

2 comments

  1. I found a piece of code that was causing this to happen, it was seemingly unrelated to the design view but removing it caused the problem. After doing this I cleaned the solution, reset all Visual Studio settings and rebuilt the entire solution. For some reason this fixed the problem. To find the code that was causing the break I followed instructions found on the Silverlight forums.

    “Try this to get a stack trace of error. Open up 1st solution but don’t call up XAML that crashes it. Open 2nd instance of VS2010, and debug the process of the first. Go into debug option and uncheck “Just my code” in Debug options. Additionally go to Debug exceptions and check the Managed code option as well as the UnManaged code options. Now go back to first instance and recreate error.”

  2. Thanks for sharing your solution – I didn’t have this problem anymore, but if it ever occurs again I’ll try this :-)

Leave a Reply