Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling triple/three slash XML comments in Visual Studio 2010 for C#

My work version of Visual Studio 2010 doesn't seem to generate XML commentary for me while coding in C# and typing ///. Yet, my Visual Studio 2010 at home does this just fine, as does the version of Visual Studio 2008 I have at work.

I have searched for the option to enable these XML comments both locally and online to no avail. Can anyone please tell me where I can toggle whether the /// XML comments are enabled? Thank you.

like image 656
jkulisic Avatar asked Feb 28 '12 11:02

jkulisic


People also ask

How to generate XML comments in C#?

To insert XML comments for a code element Do one of the following: Type /// in C#, or ''' in Visual Basic. From the Edit menu, choose IntelliSense > Insert Comment. From the right-click or context menu on or just above the code element, choose Snippet > Insert Comment.

What does triple slash do in C?

Triple-slash directives are single-line comments containing a single XML tag. The contents of the comment are used as compiler directives. Triple-slash directives are only valid at the top of their containing file.

What is the use of XML comments in C#?

C# documentation comments use XML elements to define the structure of the output documentation. One consequence of this feature is that you can add any valid XML in your documentation comments. The C# compiler copies these elements into the output XML file.

What symbols are needed for an XML comment in Visual Studio?

The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags.


2 Answers

There's an option in the Text Editor section of Tools, Options... called "Generate XML documentation comments for ///".

Generate XML documentation comments for ///

like image 133
DaveShaw Avatar answered Oct 07 '22 20:10

DaveShaw


Tools → Properties → Text Editor → C# → Advanced.

Tick the checkbox next to Generate XML documentation comments for ///.

XML comments config option

like image 36
Oded Avatar answered Oct 07 '22 21:10

Oded