VS2005 Winforms Designer Exception Screen and IE8

2020-03-12 08:17发布

问题:

It seems since I installed Internet Explorer V8 that my Winforms Designer Exception screen (WSOD) is broken. Where before I would get red text with the error described, today I get this:

WSOD Broken http://faxt.com/images/WSODBroken.png

Can anyone suggest to me a way to recover the text view of this display, I'm wasting time trying to read the reason the Winform file won't display in the designer now. Thank-you.

回答1:

I was able to fix this by adding a new subkey to the registry for .tmp and copying settings from .html. After these changes have been made, designer errors in Visual Studio should be rendered instead of displaying the HTML code for the error.

  • Open HKEY_LOCAL_MACHINE\SOFTWARE\Classes and add a new subkey of type .tmp.
  • Change the data of the (Default) value to: htmlfile
  • Add a new string value of Content Type with data of text/html
  • Add a new string value of PerceivedType with data of text


(source: lazypenguin.com)



回答2:

The problem with that fix (adding a subkey) is that now all tmp files are treated as HTML files. I found that if you are getting it trying to download the tmp file (instead of just displaying it incorrectly), the best fix is to remove the .tmp entry from the registry (and tmp_auto_file) at "HKEY_LOCAL_MACHINE\SOFTWARE\Classes" or "HKEY_CLASSES_ROOT" as they are actually the same place. It may, however, still display as text instead of a web page.



回答3:

The problem actually is "The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. "

So I've moved Form1 class in the beginning of the file (I've created several classes before it manually) - it works! Don't do anything with IE.