views:

1846

answers:

6

I have allways made a point of writing nice code comments for classes and methods with the C# xml syntax. I allways expected to easily be able to export them later on.

Today I actually have to do so, but am having trouble finding out how. Is there something I'm missing? I want to go Menu->Build->Build Code Documentation...

EDIT: This is quite a daunting task, the NDoc and Sandcastle links are probably really the way to go, but it still is a big mess, especially if all you want to do is a quick export to html :(

EDIT2: This link has an easy xslt for quick-and-dirty exports: http://www.codeproject.com/KB/XML/XMLDocStylesheet.aspx

+3  A: 

You could try NDOC or SandCastle if you dont mind using 3rd party tools.

Gulzar
+7  A: 

Actually it's in the project properties. Build tab, Output section, XML documentation file, and enter the filename. It will be built on every build of the project.

After that you can build the actual help with Sandcastle.

Biri
Yes, thankyou. It is a bit of a pain, though - just the xml stuff, I was hoping for more color ;)
Daren Thomas
You can still write an XSL/XSLT to format the XML to a more nice result.
Biri
+1  A: 

Sandcastle works pretty well for generating documentation and it supports a couple different formats for the generation. As far as I know, there isn't any Visual Studio integration for it, but there is a SandcastleGUI for it that is available.

Rob
+2  A: 

I would highly recommend you to take a look at DocProject it's specifically made to make Sandcastle use less painful.

aku
+1  A: 

Be careful if you're using LINQ to SQL as you won't be able to easily add sustainable comments to the auto-generated objects.

Alison
A: 

The original NDoc project (mentioned by others) is dead, but there is a new project called NDoc3.

NDoc3 supports .NET 2.0 - 3.5. It is currently available as a beta version and worked great for me. I'm not sure if the project is still active - the last beta was release in april 2009.

M4N