I'm moving to C# from Java and wanted to know what the most widely used documentation tool is? What is the equivalent of Javadoc in C#-land?
The default documentation format is the /// xml documentation you see in most sample code. It is parsed by the C# compiler, which creates a .xml file containing the exact location and the custom Xml. Visual Studio can use this xml for intellisense and there are a few tools that can turn this xml in pretty html.
- NDoc was the most common tool in the past, but lacks .Net 2.0 support.
- SandCastle is a more modern variant and is now used by Microsoft to generate the MSDN help.
Another useful helper is Ghostdoc that can generate a help template on clicking a shortcut like Ctrl+Shift+D in Visual Studio.
In .NET, API documentation is built-in and an XML-file is automatically generated from the source code (via XML-comments). This documentation is used by Visual Studio for the Intellisense documentation. You can use a tool like Sandcastle to convert these XML-files to CHM, or HTML, or a different format.
Use Sandcastle in conjunction with GhostDoc, which is a nice VS addin to make it easy to comment and document.
"GhostDoc is a free Visual Studio extension that automatically generates XML documentation comments for methods and properties based on their type, parameters, name, and other contextual information.
When generating documentation for class derived from a base class or for interface implementation (e.g. .NET Framework or your custom framework), GhostDoc will use the documentation that Microsoft or the framework vendor has already written for the base class or interface."
An alternative to GhostDoc is my AtomineerUtils addin. It's also free, but much more powerful, flexible and configurable.
GhostDoc to easily create the comments. (I try not to abuse it though)
Doxygen to create a set of html documentation files. Doxygen is great because it can map out the relationship between classes such as which class uses another and which class inherits from another (C++ example). For the most part Doxygen was created for C++ but it can handle C# comments as well. It's handy for exploring the architecture of foreign code, assuming they bothered to put in decent documentation.
I use GhostDoc for code documentation (it will provide you with a basic template, you would have to expand on it). I was really surprised when using DOxygen + graphviz . It can automatically generate your class diagrams/inheritance diagrams and collaboration diagrams. And you can click on these diagrams to navigate between classes. beautiful. Additionally you have the option to include your C# source code which makes cross referencing very easy. Each property/method has a reference line number in the source file and clicking on it takes you exactly to that line, rather than doing a search on the source file for that particular method/property
The Live Documenter is another alternative. Its still pretty new at the moment and allows you to view your XML code documentation live. They are currently working on exporting ala NDoc and Sandcastle. Looks really good though.
http://theboxsoftware.com/products/live-documenter/
It's free for non-commerical use.