skip to Main Content

I’m using Visual Studio 17.6.2. When I open an XML file, only the first line of the file is properly color coded. The rest of the XML file is color coded all the same: black. Where is the setting for color coding XML?

enter image description here

2

Answers


  1. In visual studio go to:
    tools > options > environment > Fonts and color

    On fonts and color tab:

    Set Show setting for = text editor
    under display items list, there are XML attributes at the end of the list.

    Select the desired attribute and change its properties, on the right.

    The available properties to update, for each item are:

    • Item foreground (color)
    • Item background (color)
    • Bold (check)
    Login or Signup to reply.
  2. [Just realized I wrote this answer about vscode rather than visual studio. There’s a good chance the same reason (line too long) applies, so I’ll leave this here. I do not use visual studio.]

    Starting at line 2, your XML is all on a single line, which is too long for color coding.

    1. Select the whole file.
    2. Issue command, "Format Document".

    The XML will now be color coded.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search