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

帅比萌擦擦* 提交于 2019-12-30 08:06:09

问题


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

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