Documentation Comments - CSharp Language Basics

CSharp examples for Language Basics:Hello World

Introduction

C# has a special type of comment to create external documentation automatically.

A sample C# application using XML documentation

/// <summary>
/// This is a summary describing the class.</summary>
/// <remarks>
/// This is a longer comment that can be used to describe
/// the class. </remarks>
class myApp
{
   /// <summary>
   /// The entry point for the application.
   /// </summary>
   /// <param name="args"> A list of command line arguments</param>
    public static void Main(string[] args)
    {
        System.Console.WriteLine("An XML Documented Program");
    }
}

To get the XML documentation, add the /doc parameter when you compile at the command line.

csc /doc:xmlfile Xmlapp.cs

Related Tutorials