Home

XML Documentation Elements for ASP.NET / C# Not yet rated

rate email bookmark Print del.icio.us technorati stumbleupon simpy

XML Documentation Elements - Almost as important as code

XML documentation elements should ALWAYS be added to your C# code-behind. Too often the excuse is that there simply isn't enough time to add comments. Well, that's a load of BS. If you get into the habbit of commenting as you code, you'll find that adding commenting is really just an extension of the coding process.

Below is a listing of the various XML documentation elements available in C# and their appropriate usage. Get familiar with the tags and make them a part of your coding mantra.

XML Documentation Elements

<c>          Indicates that the following text should be displayed in a specific "code font"
<code>       Indicates multiple lines should be marked as code
<example>    Mocks up a code example for the item you are describing
<exception>  Documents which exceptions a given class may throw
<list>       Inserts a list or table into the documentation file
<param>      Describes a given parameter
<paramref>   Associates a given XML tag with a specific parameter
<permission> Documents the security constraints for a given member
<remarks>    Builds a description for a given member
<returns>    Documents the return value of the member
<see>        Cross-references related items in the document
<seealso>    Builds an “also see” section within a description
<summary>    Documents the “executive summary” for a given member
<value>      Documents a given property

The IT world is small... a very small. Chance are your code will need to be modified by another developer, maybe for an update, or perhaps to act as a blue-print for a re-write to a newer technology. If you don't want to gain a reputation as a shoddy coder, you best start your commenting practices right now. If you don't, it may come back to bite you.

More information


David Nicolosi
Drop-In Code
Back to index