Aaaargggh…
So last night for reasons unknown one of my Web projects started crashing Visual Studio consistently. It started on one form and originally I thought this was caused by introducing ATLAS into the application, but as it turns out the problem is something else altoghether (I think).
What’s happening is that I have a few rather complex pages with lots of controls including a fair number of custom controls. This has been working fine for a long time, but all of a sudden several of these complex forms are crashing VS hard – hard so bad that Dr. Watson starts going to 100% and coming close to hanging the entire system.
I’ve been screwing around with this for a half day now and I’m still no wiser as to what introduced this failure point. I think it’s something in my own custom control assemblies that’s triggering it – if I copy in some older control assemblies the problem goes away. However, everything works fine at runtime and in design mode it’s the designer that’s bonking.
I’ve been going through my changes trying to figure out what’s causing the problems, and I do see some code changes to a couple of controls that have their OnInit() code changed from previous versions and are accessing the Page object in the OnInit(). However, this works at runtime and it surely shouldn’t crash VS. I've even gone so far as to remove the OnInit() code in the couple of controls in question with mixed results. It gets better but doesn't go away. This is really strange too - the entire page comes up every time and all controls (at least that I can see) are visible at the top of the form. However, somewhere in there the designer stops with some of hte theming and style sheet rendering half assigned which is really odd. Not always the same place though.
[Update - appropriately 10 minutes after I posted this]
Sooooooooooooooooo.... Then for some odd reason I remembered that I had some problems with some of my images used in some of the CSS themes. One of the images was generated as GIF and for some reason renamed to a PNG file. Browsers seem to not care about that and render the PNG happily anyway...
However Visual Studio is not happy with this at all apparently and crashes - MOST of the time, but not all of the time. This is why I was apparently seeing some of this partial rendering of the browser. What's odd is that it seemed to work most of the time even on forms that have this image as part of the theme.
Talk about bizarre.
Still it seems to me Visual Studio should be a lot more pro-active in preventing crashes from the Web browser control hosted in the designer. That damn thing can fail in so many ways and certainly anything related to the control should be wrappered so that it can't possibly crash VS as a whole...
Other Posts you might also like