Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the XML documentation to show for a referenced C# library?

Suppose you have a C# library with several functions, all documented with the usual /// <summary> filled out nicely. Referencing the project will make the function and parameter description appear in the Visual Studio contextual help. But is it possible to have this show if you don't reference the project itself, just a build (and potentially some other file that has the documentation inside)?

like image 482
MPelletier Avatar asked Nov 17 '10 01:11

MPelletier


People also ask

What is the comment syntax for C #s XML based documentation?

XML documentation comments - document APIs using /// comments | Microsoft Learn.

How do I read XML documents?

Just about every browser can open an XML file. In Chrome, just open a new tab and drag the XML file over. Alternatively, right click on the XML file and hover over "Open with" then click "Chrome". When you do, the file will open in a new tab.

What are XML comments in C#?

XML documentation comments are a special kind of comment, added above the definition of any user-defined type or member. They are special because they can be processed by the compiler to generate an XML documentation file at compile time. The compiler generated XML file can be distributed alongside your .

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

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.


1 Answers

Yes there is - the library needs to be built with the "XML Documentation file" tickbox checked (in the project property pages)

alt text

With this option ticked the build process will now build an extra XML file in the output directory which contains all of the xml documentation - whenever Visual Studio references an assembly by file it will load and show intellisense documentation from this XML file (if it can be found).

alt text

You should distribute this file alongside (in the same directory as) your compiled library.

like image 71
Justin Avatar answered Sep 22 '22 11:09

Justin