Different color for code comments and XML comments in VB.NET
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&l开发者_开发技巧t;/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?
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
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.
精彩评论