NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

/doc (Process Documentation Comments)

/doc:file

where:

file
The output file for XML, which is populated with the comments in the source code files of the compilation.

Remarks

The /doc option allows you to place documentation comments in an XML file.

In source code files, lines that begin with /// and that precede a user-defined type such as a class, delegate, or interface; member such as a field, event, property, or method; or a namespace declaration can be processed as comments and placed in a file.

The source code file that contains Main is output first into the XML.

Unless you compile with /target:module, file will contain <assembly></assembly> tags specifying the name of the file containing the assembly manifest for the output file of the compilation.

See Tags for Documentation Comments for ways to generate documentation from comments in your code.

Example

// compile with /doc:outfile.xml
using System;

/// A delegate that ...
delegate int MyDelegate();

namespace a {

   /// MyI defines ...
   public interface MyI {
   }

   public delegate void EventHandler(object sender, int e);

   /// MyClass is a class that ...
   public class MyClass {

      /// An enum in MyClass that defines ...
      enum Days {Sun=1, Sat, Mon, Tue, Wed, Thu, Fri};

      /// A public field in MyClass that ...
      public static int i = 0;

      /// An event in MyClass that ...
      public event EventHandler Click {
      get {
         return null;
      }

      set {
      }
   }

      /// A property in MyClass that ...
      public int Prop {
         set {
         }
   
         get {
            return 0;
         }
      }

      /// A method in MyClass, Main ...
      public static void Main () {
      }
   }
}

Program Output

See Processing the XML File to understand how the <member> tag is formed.

<?xml version="1.0"?>
<doc>
    <assembly>
        <name>outfile.exe</name>
    </assembly>
    <members>
        <member name="T:MyDelegate">
            A delegate that ...
        </member>
        <member name="T:a.MyI">
            MyI defines ...
        </member>
        <member name="T:a.MyClass">
            MyClass is a class that ...
        </member>
        <member name="F:a.MyClass.i">
            A public field in MyClass that ...
        </member>
        <member name="M:a.MyClass.Main">
            A method in MyClass, Main ...
        </member>
        <member name="E:a.MyClass.Click">
            An event in MyClass that ...
        </member>
        <member name="P:a.MyClass.Prop">
            A property in MyClass that ...
        </member>
        <member name="T:a.MyClass.Days">
            An enum in MyClass that defines ...
        </member>
    </members>
</doc>

See Also

C# Compiler Options | XML Documentation Tutorial