Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an API in .net to read XML comment documentation file [closed]

In this question I see that microsoft ships the XML documentation files for the BCL. I wonder if anyone knows if there an API within .net that can be used to look this up at runtime. I know we can parse the files manually using the XML api.

The use case is that we allow custom (read 3rd party) types/assemblies to be used in our system, and when selecting these in the UI, we'd like to extract the documentation as specified by the custom type/assembly creator or if not available provide other defaults.

like image 371
Preet Sangha Avatar asked Apr 22 '09 02:04

Preet Sangha


People also ask

How do I enable XML comment analysis?

Enabling XML Comments XML comments are enabled by default in Visual Basic projects, and cannot be disabled. To enable or disable XML comments for a specific project, go to the project properties page, the Compile tab, and update the "Generate XML documentation file" checkbox.

What is XML comment 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.

How do I auto generate comments 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.

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.


1 Answers

I maintain the Jolt.NET project on CodePlex and have implemented a feature that performs this very task. Please refer to the Jolt library for more information.

In essence, the library allows you to programatically locate and query an XML doc comments file for an assembly using the metadata types in System.Reflection (i.e. MethodInfo, PropertyInfo, etc...).

like image 156
Steve Guidi Avatar answered Oct 04 '22 17:10

Steve Guidi