How can I get user type C# syntax highlighting wor

2019-01-05 10:27发布

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 in the options dialog.

Here are some examples of items which all appear in default (black) that normally have color which don't:

  • Attributes
  • System classes
  • My own classes

And here are some keywords that still have color:

  • using
  • public
  • void
  • var
  • for

Has anyone else experienced this and managed to fix it?

19条回答
SAY GOODBYE
2楼-- · 2019-01-05 10:44

It work for download this "Productivity Power Tools 2012" and install, after install this tool get this steps go to Tools -> Options -> Productivity Power Tools and turn off the "Colorized Parameter Help" option.

This fixed the keyword as syntax ActionResult is not set for default black color and highlight problem resolved.

查看更多
不美不萌又怎样
3楼-- · 2019-01-05 10:45

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!

查看更多
Animai°情兽
4楼-- · 2019-01-05 10:45

If you've installed the preview of Roslyn, unintstall it. This worked for me.

查看更多
Luminary・发光体
5楼-- · 2019-01-05 10:49

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.

查看更多
The star\"
6楼-- · 2019-01-05 10:49

exit devenv

go to below path hkey_current_user\software\microsoft\visualstudio!

remove 9.0 , 10.0 , 10.0_config (i mean to say all other folders except 11.0 and 11.0_config)

Now start devenv and see the magical colors get back normal

查看更多
再贱就再见
7楼-- · 2019-01-05 10:50

If you still have this issue try ResetSettings (worked for me)

NOTE: this will reset the Visual Studio 2012 settings :)

1) close vs.

2)open cmd (as administrator).

3) go to devnev.exe folder (something like "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" ).

4) type "devnev.exe /ResetSettings"

5) open vs and look at the beautiful colors

查看更多
登录 后发表回答