Wednesday, November 09, 2005

 

Thanks to Shawn Burke !!!

Shawn has posted a comment to my entry on the forms designer crashing, which I reproduce here because it helped to solve my problems. It had not occured to me to debug the IDE, and doing so helped me to track down a few instances where the form designer didn't like my controls, even though they always work perfectly at runtime. The controls in question were not even visible, but in the new IDE, they were bringing things to an abrupt halt.


Two things:

1) Go to your project directory, list the hidden files and look for one ending in .suo. Delete that file. This file just tracks what you had open, so you won't lose anything important.

2) You should now be able to start VS. Start two instances of VS, attach one to the other (Debug >> Processes >> devenv.exe).

3) Choose Exceptions >> CLR Exceptions >> Break when exception is thrown

4) Go the the other version of VS (the one that's being debugged) and open your form.You'll start breaking on exceptions. Hit continue until you see an exception of type ArgumentException.Look at the stack, and post it here. If it's something in your code you can fix it but in either case the designer shouldn't crash there, so the stack will tell us where we're letting an exception sneak through. We did a bunch of work to catch all of those, but there's a lot of possible nooks and crannies.

So, basically, debug the IDE and you'll see where the designer is having trouble. Change your code so that the designer is happy, and all will be well. Certainly at this stage it seems that my form is able to show itself over and over again as a result of the changes I have made ( at one point, my code shows a bitmap via a property, and if null was passed in, it would simply not process it. The designer seems to be passing in a Bitmap with a pixel format of Undefined, which was crashing my code, so now I check for this and reject it also ).

Comments:
Cool, this just help me with an HTML editor control I was having trouble with. Thanks CG.
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?