27 Oct 2010

Documenting C# ASP,NET Code Projects and Solutions

We all know we should be using ///<summary> and ///<remark> tags in our code to document it properly, right?

The cool thing about that is that you can then generate an XML file from Visual Studio with all your code comments in it.
To do that, right-click on your Project in Solution Explorer and choose the "Build" tab. Check the box marked "XML documentation file" and voila - next time you build, the XML file will be generated too.

Then what? Then, my friend, you can distribute the xml file with your dll, and other developers will be able to see your comments on your class methods and properties.

Also, you can generate a Help file (CHM)! To do that, download and install Sandcastle and the SandCastle Help File Builder (SHFB).

Then in SHFB, you can just drag in your DLL and the XML file will be automatically included.
Build your Help File and a CHM will be generated!
Open it from a local drive (CHMs don't work on a remote drive) and enjoy!

No comments:

Post a Comment

Comments are very welcome unless you're a spammer, in which case you should probably kill yourself.

If I helped you out today, you can buy me a beer below. Cheers!