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/ide/reference/generate-xml-documentation-comments.md
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Insert XML documentation comments
3
3
description: Learn how to insert XML documentation comments in your code that you can use to create a compiler-generated XML file to distribute alongside your .NET assembly.
4
4
ms.custom: SEO-VS-2020
5
-
ms.date: 01/22/2020
5
+
ms.date: 11/23/2021
6
6
ms.topic: reference
7
7
author: mikadumont
8
8
ms.author: midumont
@@ -13,15 +13,15 @@ ms.workload:
13
13
---
14
14
# How to: Insert XML comments for documentation generation
15
15
16
-
Visual Studio can help you document code elements such as classes and methods, by automatically generating the standard XML documentation comment structure. At compile time, you can generate an XML file that contains the documentation comments.
16
+
Visual Studio can help you document code elements such as classes and methods, by automatically generating the standard XML documentation comment structure. At compile time, you can generate an XML file that contains the documentation comments. To enable that option, select **Generate a file containing API documentation** on the **Build** > **Output** tab of your project's properties.
17
17
18
18
> [!TIP]
19
-
> For information about configuring the name and location of the generated XML file, see [Documenting your code with XML comments (C# Guide)](/dotnet/csharp/codedoc).
19
+
> If you want to configure a non-default name and location for the documentation file, add the [DocumentationFile](/dotnet/core/project-sdk/msbuild-props#documentationfile) property to your *.csproj*, *.vbproj*, or *.fsproj* file.
20
20
21
21
The compiler-generated XML file can be distributed alongside your .NET assembly so that Visual Studio and other IDEs can use IntelliSense to show quick information about types and members. Additionally, the XML file can be run through tools like [DocFX](https://dotnet.github.io/docfx/) and [Sandcastle](https://www.microsoft.com/download/details.aspx?id=10526) to generate API reference websites.
22
22
23
23
> [!NOTE]
24
-
> The **Insert Comment** command that automatically inserts XML documentation comments is available in [C#](/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments) and [Visual Basic](/dotnet/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation). However, you can manually insert [XML documentation comments in C++](/cpp/build/reference/xml-documentation-visual-cpp) files and still generate XML documentation files at compile time.
24
+
> The **Insert Comment** command that automatically inserts XML documentation comments is available in [C#](/dotnet/csharp/programming-guide/xmldoc/) and [Visual Basic](/dotnet/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation). However, you can manually insert [XML documentation comments in C++](/cpp/build/reference/xml-documentation-visual-cpp) files and still generate XML documentation files at compile time.
25
25
26
26
## To insert XML comments for a code element
27
27
@@ -47,15 +47,14 @@ The compiler-generated XML file can be distributed alongside your .NET assembly
47
47
48
48
You can use styles in XML comments that will render in Quick Info when hovering over the element. These styles include: italics, bold, bullets, and a clickable link.
49
49
50
-

50
+

51
51
52
52
> [!NOTE]
53
53
> There is an [option](../../ide/reference/options-text-editor-csharp-advanced.md) to toggle XML documentation comments after typing `///` in C# or `'''` Visual Basic. From the menu bar, choose **Tools** > **Options** to open the **Options** dialog box. Then, navigate to **Text Editor** > **C#** or **Basic** > **Advanced**. In the **Editor Help** section, look for the **Generate XML documentation comments** option.
Copy file name to clipboardExpand all lines: docs/ide/reference/options-text-editor-csharp-advanced.md
+15-16Lines changed: 15 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -84,13 +84,13 @@ Use the **Advanced** options page to modify the settings for editor formatting,
84
84
usingSystem.Linq;
85
85
```
86
86
87
-
::: moniker range=">=vs-2019"
87
+
::: moniker range=">=vs-2019"
88
88
- Suggest usings for types in .NET Framework assemblies
89
89
::: moniker-end
90
-
91
-
::: moniker range="vs-2017"
90
+
91
+
::: moniker range="vs-2017"
92
92
- Suggest usings for types in reference assemblies
93
-
::: moniker-end
93
+
::: moniker-end
94
94
95
95
- Suggest usings for types in NuGet packages
96
96
@@ -132,25 +132,25 @@ Select these check boxes to display dotted vertical lines between the curly brac
132
132
133
133
- Generate XML documentation comments for ///
134
134
135
-
When selected, inserts the XML elements for XML documentation comments after you type the `///` comment introduction. For more information about XML documentation, see [XML Documentation Comments (C# Programming Guide)](/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments).
135
+
When selected, inserts the XML elements for XML documentation comments after you type the `///` comment introduction. For more information about XML documentation, see [XML Documentation Comments (C# Programming Guide)](/dotnet/csharp/programming-guide/xmldoc/).
136
136
137
137
::: moniker range=">=vs-2019"
138
138
139
139
## Inline Hints
140
140
141
-
- Inline Parameter Name Hints
142
-
143
-
When selected, inserts parameter name hints for literals, cast literals, and object instantiations prior to each argument in function calls.
144
-
141
+
- Inline Parameter Name Hints
142
+
143
+
When selected, inserts parameter name hints for literals, cast literals, and object instantiations prior to each argument in function calls.
144
+
145
145

146
146
147
-
- Inline Type Hints
148
-
149
-
When selected, inserts type hints for variables with inferred types and lambda parameter types.
150
-
147
+
- Inline Type Hints
148
+
149
+
When selected, inserts type hints for variables with inferred types and lambda parameter types.
150
+
151
151

152
152
153
-
## Inheritance Margin
153
+
## Inheritance Margin
154
154
155
155
- When selected, adds icons to the margins representing your code's implementations and overrides. Clicking on the inheritance margin icons will display inheritance options that you can select to navigate to.
156
156
@@ -161,7 +161,6 @@ Select these check boxes to display dotted vertical lines between the curly brac
161
161
## See also
162
162
163
163
-[How to: Insert XML comments for documentation generation](../../ide/reference/generate-xml-documentation-comments.md)
0 commit comments