Export (0) Print
Expand All
Expand Minimize

/doc (Process Documentation Comments) (C# Compiler Options) 

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


/doc:file

file

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

In source code files, documentation comments that precede the following can be processed and added to the XML file:

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

To use the generated .xml file for use with the IntelliSense feature, let the file name of the .xml file be the same as the assembly you want to support and then make sure the .xml file is in the same directory as the assembly. Thus, when the assembly is referenced in the Visual Studio project, the .xml file is found as well. See Supplying Code Comments and for more information.

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.

NoteNote

The /doc option applies to all input files; or, if set in the Project Settings, all files in the project. To disable warnings related to documentation comments for a specific file or section of code, use #pragma warning.

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

See XML Documentation Sample for a sample.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Properties page. For details, see How to: Set Project Properties (C#, J#).

  2. Click the Build property page.

  3. Modify the XML Documentation File property.

For information on how to set this compiler option programmatically, see DocumentationFile.

Community Additions

ADD
Show:
© 2014 Microsoft