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:
- Start Microsoft Visual C# 2010 Express.
- Open your project (or start a new one, type in needed code and compile/build).
- In Solution Explorer, create a new folder called doc in the root of the project tree.
- In Solution Explorer, right-click the project name and click Properties.
- In the left pane, click Build category.
- Tick/check XML documention file option and type doc/somename.xml in the text field.
- Save All.
- Put a triple slash XML comments in your source code like this (<param name="args"></param>
tag is needed for the XML file to be generated properly):
/// <summary>
/// comment
/// </summary>
/// <param name="args"></param>
See Program.cs example below to find out where to put the XML comments.
- Press Ctrl + F5 to compile/build. The XML file containing XML comments is generated.
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