Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No syntax highlighting or intellisense for C# files in VS 2012

I've just installed the RTM version of VS2012 Premium from MSDN (11.0.50727.1). I have created an C# ASP.NET MVC 4 application, and a C# console application, but neither give me syntax highlighting or Intellisense for the following file types:

  • cs
  • cshtml

BUT all other file types seem to work fine, including:

  • html
  • js
  • XML
  • CSS
  • config

I am running on Windows 7, virtualized in VMWare Fusion 5, on Mac OSX Lion. I also have VS 2010 installed in the same VM, which has and still does run fine.

I have tried running devenv.exe /setup with no success.

I have tried Tools > Import and Export Settings > Reset with no success.

Anyone got any ideas how to get this working?

like image 437
Mike Chamberlain Avatar asked Aug 30 '12 13:08

Mike Chamberlain


People also ask

How do I turn my IntelliSense back on?

You can enable or disable particular IntelliSense features in the Options dialog box, under Text Editor > C/C++ > Advanced.

Why is my IntelliSense not working?

If IntelliSense is not working as it should on your Windows 11/10 PC, you can try restarting VS Code and this should solve the issue. Restarting the program can be really effective and time saving in some cases. If the issue persists, you can try restarting your computer altogether.


2 Answers

I found I also had Visual Studio 2012 Web Express RC installed. When I uninstalled this, C# intellisense and syntax highlighting magically started to work.

like image 199
Mike Chamberlain Avatar answered Nov 01 '22 06:11

Mike Chamberlain


I found I had to run

devenv /resetuserdata

I chose not to import from previous versions. I had to re-enter all my TFS connections but now my app.config is in color in VS2012.

like image 24
Peter Hecht Avatar answered Nov 01 '22 07:11

Peter Hecht