You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/reflection-and-codedom/how-to-create-an-xml-documentation-file-using-codedom.md
+16-14
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,11 @@ helpviewer_keywords:
10
10
- "Code Document Object Model, generating XML documentation"
11
11
ms.assetid: e3b80484-36b9-41dd-9d21-a2f9a36381dc
12
12
---
13
-
# How to: Create an XML Documentation File Using CodeDOM
13
+
# How to: Create an XML documentation file using CodeDOM
14
+
14
15
CodeDOM can be used to create code that generates XML documentation. The process involves creating the CodeDOM graph that contains the XML documentation comments, generating the code, and compiling the generated code with the compiler option that creates the XML documentation output.
15
16
16
-
### To create a CodeDOM graph that contains XML documentation comments
17
+
##Create a CodeDOM graph
17
18
18
19
1. Create a <xref:System.CodeDom.CodeCompileUnit> containing the CodeDOM graph for the sample application.
19
20
@@ -22,27 +23,28 @@ CodeDOM can be used to create code that generates XML documentation. The process
1. Use the <xref:System.CodeDom.Compiler.CodeDomProvider.GenerateCodeFromCompileUnit%2A> method to generate the code and create a source file to be compiled.
### To compile the code and generate the documentation file
33
+
### Compile the code and generate the documentation file
33
34
34
35
1. Add the **/doc** compiler option to the <xref:System.CodeDom.Compiler.CompilerParameters.CompilerOptions%2A> property of a <xref:System.CodeDom.Compiler.CompilerParameters> object and pass the object to the <xref:System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile%2A> method to create the XML documentation file when the code is compiled.
The following code example creates a CodeDOM graph with documentation comments, generates a code file from the graph, and compiles the file and creates an associated XML documentation file.
40
+
## Example
41
+
42
+
The following code example creates a CodeDOM graph with documentation comments, generates a code file from the graph, and compiles the file and creates an associated XML documentation file.
Copy file name to clipboardExpand all lines: docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -7,29 +7,29 @@ helpviewer_keywords:
7
7
- "Visual Basic code, documenting with XML"
8
8
ms.assetid: a0d35dc7-c5f9-4d74-92ff-a1c6f28d5235
9
9
---
10
-
# Documenting Your Code with XML (Visual Basic)
10
+
# Document your code with XML (Visual Basic)
11
11
12
-
In Visual Basic, you can document your code using XML
12
+
In Visual Basic, you can document your code using XML.
13
13
14
-
## XML Documentation Comments
14
+
## XML documentation comments
15
15
16
-
Visual Basic provides an easy way to automatically create XML documentation for projects. You can automatically generate an XML skeleton for your types and members, and then provide summaries, descriptive documentation for each parameter, and other remarks. With the appropriate setup, the XML documentation is automatically emitted into an XML file with the same name as your project and the .xml extension. For more information, see [-doc](../../reference/command-line-compiler/doc.md).
16
+
Visual Basic provides an easy way to automatically create XML documentation for projects. You can automatically generate an XML skeleton for your types and members, and then provide summaries, descriptive documentation for each parameter, and other remarks. With the appropriate setup, the XML documentation is automatically emitted into an XML file with the same root file name as your project. For more information, see [-doc](../../reference/command-line-compiler/doc.md).
17
17
18
18
The XML file can be consumed or otherwise manipulated as XML. This file is located in the same directory as the output .exe or .dll file of your project.
19
19
20
20
XML documentation starts with `'''`. The processing of these comments has some restrictions:
21
21
22
22
- The documentation must be well-formed XML. If the XML is not well formed, a warning is generated and the documentation file contains a comment saying that an error was encountered.
23
23
24
-
- Developers are free to create their own set of tags. There is a recommended set of tags (see "Related Sections" in this topic). Some of the recommended tags have special meanings:
24
+
- Developers are free to create their own set of tags. There is a recommended set of tags (see [XML Comment Tags](../../language-reference/xmldoc/index.md)). Some of the recommended tags have special meanings:
25
25
26
26
- The \<param> tag is used to describe parameters. If used, the compiler will verify that the parameter exists and that all parameters are described in the documentation. If the verification fails, the compiler issues a warning.
27
27
28
28
- The `cref` attribute can be attached to any tag to provide a reference to a code element. The compiler verifies that this code element exists. If the verification fails, the compiler issues a warning. The compiler also respects any `Imports` statements when looking for a type described in the `cref` attribute.
29
29
30
30
- The \<summary> tag is used by IntelliSense in Visual Studio to display additional information about a type or member.
31
31
32
-
## Related Sections
32
+
## Related sections
33
33
34
34
For details on creating an XML file with documentation comments, see the following topics:
0 commit comments