问题
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?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/12197771/no-syntax-highlighting-or-intellisense-for-c-sharp-files-in-vs-2012