Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Comments -- How (or where) do you create XML comments for your namespaces and library?

I understand that if you /// above a class, field, method, or property Visual Studio will start establishing XML-style comments for you.

However, where can I go to add XML comments for my namespaces and/or library...

For example:

  • .NET Framework Class Library
    • System.Collections Namespaces
      1. System.Collections Namespace
      2. System.Collections.Concurrent Namespace
      3. ...

I'm not sure if those pages were manually created or if they were automatically created via XML-style comments being added in the proper locations?

like image 453
michael Avatar asked May 19 '11 20:05

michael


People also ask

How do you make a comment in XML?

An XML comment encountered outside the document type declaration is represented by the Comment value syntax element. It contains the comment text from the XML message. If the value of the element contains the character sequence --> , the sequence is replaced with the text --> .

What is the proper commenting method for XML?

To insert XML comments for a code element Type /// in C#, or ''' in Visual Basic.

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.


1 Answers

That depends on the tool you use to generate your documentation. With NDoc, I believe, you simply had to create a class called NamespaceDoc inside the namespace you wanted to document. The XML-Comment of that class would have then be used.

Since the question is tagged with "sandcastle", I assume you are indeed using it. If so, this SO answer should give the details.

Update: OK, I just (in that same thread) saw that apparently Sandcastle understands NamespaceDoc-classes as well. Somebody might want to close this question as a duplicate.

like image 71
Christian.K Avatar answered Sep 16 '22 17:09

Christian.K