7

I've noticed that in C# XML comments and code comments can have different colors by changing the settings in Tools > Options > Environment > Fonts and Colors > Display Items: - Comment: controls code comments - XML comment: controls XML comments

This works well in C#

///<summary>This XML comment is green</summary>

//This code comment is red

But not in VB.NET

'''<summary>This XML comment appears red too even though it's configured as green</summary>

'This code comment is red

Is there a way to fix this?

3
  • I forgot to mention: I'm using Visual studio 2005 Commented Sep 26, 2011 at 10:54
  • Thanks guys, I guess it's a VS 2005 problem. I need to upgrade! Commented Sep 27, 2011 at 10:32
  • Yes it was a VS 2005 issue. I've updated to VS 2010 and it works fine. Commented Oct 12, 2011 at 12:53

2 Answers 2

10

The coloring settings for VB and C# are different for each language.

Here's a partial list of the corresponding settings between the two:

C#                 VB
Comment            Comment
XML Doc Attribute  VB XML Attribute
XML Doc Comment    VB XML Comment (the second one)
XML Doc Tag        VB XML Doc Tag
Sign up to request clarification or add additional context in comments.

Comments

3

I don't know which IDE you're using to develop in. For Visual Studio 2010, Click on Tools > Options > Environment > Fonts and Colors. In the Show settings for drop down list, select Text Editor.

In Display Items: select Comment. This will change the color of the comments within code.

Next in Display Items: select VB XML Comment. This will change the color of the XML comments which are used. There may be 2 items with the same name; I had to change the second one.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.