9

I am using Visual Studio 2010 and have started being a good boy and documenting all my code as I write it, via XML comments. I have a well-documented project and I even figured out how to make Visual Studio spit out a complete XML document when doing a build. My question is, what is the best way to format/display this document on the web so that it appears in a nice friendly and usable format like MSDN? Is there a tool that does this easily?

Thanks in advance!

CatDadCode
  • 58,507
  • 61
  • 212
  • 318
  • possible duplicate of [Does Visual Studio have an option to generate html documentation for Javadoc-style comments?](http://stackoverflow.com/questions/1935351/does-visual-studio-have-an-option-to-generate-html-documentation-for-javadoc-sty) – Alfabravo Jul 24 '13 at 15:44

5 Answers5

16

Check out Sandcastle.

Sandcastle produces accurate, MSDN style, comprehensive documentation by reflecting over the source assemblies and optionally integrating XML Documentation Comments.

Wikipedia has more information and links to additional projects that integrate with sandcastle.


Another option (which appears to be much easier to use) is docu:

A documentation generator for .Net that isn't complicated, awkward, or difficult to use. Given an assembly and the XML that's generated by Visual Studio, docu can produce an entire website of documentation with a single command.


A third option is NDoc:

NDoc generates class library documentation from .NET assemblies and the XML documentation files generated by the C# compiler (or with an add-on tool for VB.NET).

NDoc uses pluggable documenters to generate documentation in several different formats, including the MSDN-style HTML Help format (.chm), the Visual Studio .NET Help format (HTML Help 2), and MSDN-online style web pages.

Community
  • 1
  • 1
Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • That's funny, that's the first one I encountered. It seemed rather cumbersome. I don't think it reads from the generated XML document, instead it reads from the .cs files themselves. This is one option for sure, but I'd like to see if anyone else has other options to put forward. – CatDadCode Mar 04 '11 at 20:43
  • @Chevex - it's been the king for years... I have updated my answer with another option. – Oded Mar 04 '11 at 20:46
  • I want to use sandcastle but it's confusing me quite a bit. I installed it but have no clear where it went. Does it have a GUI? – CatDadCode Mar 04 '11 at 20:55
  • 1
    @Chevex - It is notoriously difficult to use. See the other options I added. docu looks like a good one. – Oded Mar 04 '11 at 21:01
  • Docu generates an error whenever I try to use it, unfortunately. It says it encountered a user-defined breakpoint. However that's possible. – CatDadCode Mar 04 '11 at 21:06
  • 1
    I wish I could just find a good fool-hardy tutorial for using sandcastle. It is installed and I still have no idea where to even access it's options. – CatDadCode Mar 04 '11 at 21:07
5

Check out Sandcastle Help File Builder. This is a GUI tool that makes Sandcastle pretty easy to work with. It will install to a folder in Start Menu->Program Files->Sandcastle Help File Builder.; It's pretty easy to use, but it's not incredibly fast.

Hope that helps!

pmartin
  • 2,731
  • 1
  • 25
  • 30
  • 1
    I managed to get this to create documentation during Visual Studio's build event. Check out my answer on this question: http://stackoverflow.com/questions/211693/generate-html-documentation-automatically-during-a-build-with-sandcastle/5200822#5200822 – CatDadCode Mar 07 '11 at 16:44
0

I have created an Open source project to expose them in WebPages Check @ AutoHelp

AutoHelp reads the DLL & XML Doc files, generates help pages and exposes them to the users. AutoHelp uses ASP.NET MVC 5, ASP.NET WebApi, TypeScript, jQuery and Bootstrap to be a modern web app.

Raynald
  • 81
  • 1
  • 6
0

NDoc is also an option. But i would go with sand castle and that was what i did.

adt
  • 4,320
  • 5
  • 35
  • 54
0

In 2020 you probably want to go with doxygen. Works like a charm for my .NET Core project.

Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL and to some extent D.

Doxygen can export to HTML, LaTeX, RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources.

Community
  • 1
  • 1
eddex
  • 1,622
  • 1
  • 15
  • 37