Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inherit documentation in C#?

From Java and Eclipse I'm used to @inheritDoc that allows to use the same documentation as in the base class/method.

How can I accomplish something similar in C# and Visual Studio 2010?

like image 902
RoflcoptrException Avatar asked Mar 14 '11 20:03

RoflcoptrException


People also ask

What is inheritdoc/>?

The @inheritdoc tag indicates that a symbol should inherit its documentation from its parent class. Any other tags that you include in the JSDoc comment will be ignored. This tag is provided for compatibility with Closure Compiler.

What is cref C#?

The cref attribute in an XML documentation tag means "code reference." It specifies that the inner text of the tag is a code element, such as a type, method, or property.

How do you write a summary comment in C#?

The first rule for commenting is it should have /// three slash for comments as C# supports C++ style commenting so commenting can be done by // -- two slashes -- but for Documentation /// is necessary. We will go through each one by one. You can add a paragraph to the description by using <para> tag.

How do I create an XML document in Visual Studio?

From the menu bar, choose Tools > Options to open the Options dialog box. Then, navigate to Text Editor > C# (or Visual Basic) > Advanced. In the Editor Help section, look for the Generate XML documentation comments option.


2 Answers

Even this question is a few years old and it was specifically for Visual Studio 2010. For all those that land here by Google, I would like to add an answer that I found and that holds true for Visual Studio 2015 in combination with Sandcastle Help File Builder (SHFB):

/// <inheritdoc/> 

can be used to inherit the docs from a base class or an interface.

Here a link to the Sandcastle Help File Builder (SHFB) documentation: Using the <inheritdoc /> Tag

like image 145
Horoman Avatar answered Sep 22 '22 14:09

Horoman


It doesn't exist in vanilla VS. Your best bet is ghostdoc or similar. This is available in the Extension Manager, or here

like image 33
Marc Gravell Avatar answered Sep 20 '22 14:09

Marc Gravell