Syntax highlighting for html markup disappears in Visual Studio 2008

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 09:48:34

问题


This happened to me in Visual Studio 2008 pre and post 2008 sp1 on more than one computer and to someone else I know, so it can't be an isolated incident.

Seemingly random, every so often I lose all syntax highlighting in my aspx page (the html) so that Visual Studio now looks like a really expensive version of notepad.

Does anyone know why does happens? Better yet, anyone know how to fix it?


回答1:


it happened to me after an uninstall of visual studio using a removal tool at http://msdn.microsoft.com/en-us/vstudio/bb968856.aspx I had to run this before upgrading sql server management studio to 2008 version syntax highlighting has disappeared since because of package loading failures. I didn't find the fix yet so if anybody has an idea...




回答2:


You have basically experienced Visual Studio giving up. It gives up for many reason, the page is too complicated to highlight which is usually because there are too many syntax errors. The highlighting is done with some very complicated and intelligent RegEx statements essentially, however if Visual Studio is unable to apply them it just displays black text.

One thing to try is to fix all the syntax issues, if any.

By the way this "giving up" happens in most IDE's. I have seen it happen once or twice in Elcipse too.




回答3:


Try Ctrl-K, Ctrl-D (reformat document). This will usually restore you syntax coloring. If it doesn't, it should tell you where it got confused (e.g. Couldn't reformat due to line 123).




回答4:


I've followed the instructions from Andrea but had to include the following procedure:

Andrea Instructions: Enter VS2008, click on Tools/Options

Check "Show all settings" option

Choose Environment/International Settings

Change the language combo box.

Close VS2008.

...then... After closing Visual Studio, run this command below from a command prompt with admin permission:

run devenv /resetskippkgs

Reference: http://forums.asp.net/t/1413383.aspx




回答5:


when this happens to me, i let it sit there for a minute. it will usually bring the syntax highlighting back.




回答6:


i had the same problem. Installation of DPack

solved this issue




回答7:


Enter VS2008, click on Tools/Options

Check "Show all settings" option

Choose Environment/International Settings

Change the language combo box.

Close VS2008.



来源:https://stackoverflow.com/questions/45577/syntax-highlighting-for-html-markup-disappears-in-visual-studio-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!