共用方式為


/doc 

Processes documentation comments to an XML file.

/doc[+ | -]
' -or-
/doc:file

Arguments

  • + | -
    Optional. Specifying +, or just /doc, causes the compiler to generate documentation information and place it in an XML file. Specifying - is the equivalent of not specifying /doc, causing no documentation information to be created.
  • file
    Required if /doc: is used. Specifies the output XML file, which is populated with the comments from the source-code files of the compilation. If the file name contains a space, surround the name with quotation marks (" ").

Remarks

The /doc option controls whether the compiler generates an XML file containing the documentation comments. If you use the **/doc:**file syntax, the file parameter specifies the name of the XML file. If you use /doc or /doc+, the compiler takes the XML file name from the executable file or library that the compiler is creating. If you use /doc- or do not specify the /doc option, the compiler does not create an XML file.

In source-code files, documentation comments can precede the following definitions:

To use the generated XML file with the Visual Studio IntelliSense feature, let the file name of the XML file be the same as the assembly you want to support. Make sure the XML file is in the same directory as the assembly so that when the assembly is referenced in the Visual Studio project, the .xml file is found as well. XML documentation files are not required for IntelliSense to work for code within a project or within projects referenced by a project.

Unless you compile with /target:module, the XML file contains the tags <assembly></assembly>. These tags specify the name of the file containing the assembly manifest for the output file of the compilation.

See Recommended XML Tags for Documentation Comments (Visual Basic) for ways to generate documentation from comments in your code.

To set /doc in the Visual Studio integrated development environment

  1. Have a project selected in Solution Explorer. On the Project menu, click Properties. For more information, see Introduction to the Project Designer.

  2. Click the Compile tab.

  3. Set the value in the Generate XML documentation file box.

Example

See Documenting Your Code with XML (Visual Basic) for a sample.

See Also

Concepts

Documenting Your Code with XML (Visual Basic)

Other Resources

Visual Basic Compiler