IT-info > C#.NET

C#.NET

XML comments

XML comments are not applicable in Microsoft Web Developer 2010 Express.
XML comments can only be used in Visual Studio program(s) source code.

Here's how to generate a XML file containing XML comments in Microsoft Visual C# 2010 Express:

Program.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloWorld
{
    class Program
    {
        /// <summary>
        /// comment
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world!");
        }
    }
}

xmlcomment.xml:

<?xml version="1.0"?>
<doc>
    <assembly>
        <name>HelloWorld</name>
    </assembly>
    <members>
        <member name="M:HelloWorld.Program.Main(System.String[])">
            <summary>
            comment
            </summary>
            <param name="args"></param>
        </member>
    </members>
</doc>

More info:
http://stackoverflow.com/questions/17720534/xml-comment-for-method-main
http://www.codeproject.com/Articles/11082/C-and-XML-Source-Code-Documentation