How can I get user type C# syntax highlighting working again in VS 2012 RC?

前端 未结 19 2211
无人及你
无人及你 2020-11-27 12:23

Somehow part of my syntax highlighting for C# code has disappeared in the VS 2012 IDE. Uninstalling, rebooting, and reinstalling does nothing, nor does resetting the colors

相关标签:
19条回答
  • 2020-11-27 12:36

    Here is a simple solution. Go to the directory where devenv is (for 2012 RC), and type devenv.exe /setup. It will fix your problem.

    devenv.exe is usually in something like C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE.

    Edit: It has been suggested that you do this from the Visual Studio command prompt (Start>Microsoft Visual Studio>Tools>Visual Studio Command Prompt), and/or make sure your command prompt has administrator permissions.

    Note for others: This has a very good chance of working for many other versions of Visual Studio, including 2008, 2010, 11 beta, ...

    0 讨论(0)
  • 2020-11-27 12:36

    After trying several of the solutions listed here, I eventually found that my issue was caused by a very large (488000+ characters) string variable. Highlighting was working up to that line, but not after it. Once I reduced the length of the string, highlighting in the rest of the file resumed working normally.

    0 讨论(0)
  • 2020-11-27 12:37

    Problem : Class name and Syntax showing in black color

    Solutation:

    Step 1: Remove Key :
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\FontAndColors

    Step 2: Remove folder :
    C:\Users\UserName\AppData\Roaming\Microsoft\VisualStudio\12.0

    Step 3: Open command prompt (admin mode) and run below command line :
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>devenv.exe /setup
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>devenv.exe /ResetSettings

    0 讨论(0)
  • 2020-11-27 12:39

    My problem was limited to having the "DateTime" type not showing up in light blue like other class names. I fixed it by simply switching back-and-forth between VS Themes. Discovered by accident. Much quicker than reset settings or repair install...

    VS menu Tools -> Change Color Theme

    0 讨论(0)
  • 2020-11-27 12:39

    This is what worked for me:

    1 - delete all in C:\Users\userNAme\AppData\Roaming\Microsoft\VisualStudio\11.0
    2 - open vs console as administrator, and run:
          devenv.exe /setup
          devenv.exe /ResetSettings
    

    This will reset all your environment settings.

    0 讨论(0)
  • 2020-11-27 12:39

    I did all the things listed here and still nothing (VS2013 Update 3). I tried /setup, /resetsettings, deleting the stuff in AppData, deleting the registry keys. Still, User Types wouldn't be highlighted even in the default color scheme.

    What helped in the end was opening the Fonts and Colors dialog, selecting Identifier, and making it Bold. Then removing the Bold. Instant fixage!

    0 讨论(0)
提交回复
热议问题