views:

523

answers:

5

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  A: 

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.

Nick Berardi
A: 

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

cowgod
I don't why It was voted negatively. It works to me sometimes.
Adones Cunha
+1  A: 

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).

Herb Caudill
+1  A: 

Hi 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...

A: 

i had the same problem. Installation of DPack

solved this issue

eldar