Reputation: 3918
I'm writing a library and I want to put documentation in my functions so that it will show up in intellisense, kind of like how the intellisense for the built in functions shows descriptions for each of the parameters and for the function itself. How do you put the documentation in? Is it through comments in the function or is it in some separate file?
Upvotes: 33
Views: 24014
Reputation: 136
To auto-generate the three-slash comment section on top of an existing method, just place the cursor on an empty line, right above the method definition and type three forward slashes ("///"). Visual Studio will auto-generate a three-slash comment that corresponds to your method. It will have placeholders for the summary, each parameter (if any) and the return value (if any). You just have to fill-in the blanks.
I would recommend you don't try to write these description blocks by hand and not to copy from one method to another. Third-party tools are also not necessary to generate them (at least in Visual Studio 2010).
Upvotes: 10
Reputation: 1041
"XML Documentation Comments (C# Programming Guide) In Visual C# you can create documentation for your code by including XML tags in special comment fields in the source code directly before the code block they refer to."
http://msdn.microsoft.com/en-us/library/b2s063f7.aspx
you can then use Sandcastle to generate chm files too if you want
Upvotes: 5
Reputation: 109100
As well as the XML comments you need to enable building the documentation (in the project settings) and keep the generated XML file with the assembly.
Upvotes: 2