19

I have always made a point of writing nice code comments for classes and methods with the C# xml syntax. I always 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, but there is no option to do that, there.

Mogsdad
  • 40,814
  • 19
  • 140
  • 246
Daren Thomas
  • 61,662
  • 38
  • 143
  • 192
  • _OP had appended this suggestion:_ This link has an easy xslt for quick-and-dirty exports: http://www.codeproject.com/KB/XML/XMLDocStylesheet.aspx – Mogsdad Jan 17 '18 at 17:33

7 Answers7

25

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
  • 6,605
  • 7
  • 34
  • 52
4

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

Gulzar Nazim
  • 50,518
  • 24
  • 125
  • 170
1

Late comment, but worth adding that even though Sandcastle is mothballed, the Sandcastle Help File Builder remains in active development, and I found it very powerful and straightforward to dive into when dealing with just this situation--install to rich .chm and .html/.asp output in a couple hours.

downwitch
  • 1,322
  • 2
  • 19
  • 38
1

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.

rjzii
  • 13,621
  • 12
  • 79
  • 116
1

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.

NakedBrunch
  • 45,899
  • 13
  • 69
  • 97
0

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
  • 90,223
  • 44
  • 210
  • 255
0

The previous answers are really out of date. Here are some more modern options:

  • DocFX: This is probably your best bet because it runs on Linux, macOS, and Windows and it's supported by the .NET Foundation.
  • Sandcastle Help File Builder (SHFB): This one is still supported but it might not be as active.
Brent Matzelle
  • 3,715
  • 3
  • 24
  • 26