Skip to content

Commit 1acba76

Browse files
authored
improve xml documentation docs (#9096)
1 parent 5bd80b0 commit 1acba76

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

docs/ide/reference/generate-xml-documentation-comments.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Insert XML documentation comments
33
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.
44
ms.custom: SEO-VS-2020
5-
ms.date: 01/22/2020
5+
ms.date: 11/23/2021
66
ms.topic: reference
77
author: mikadumont
88
ms.author: midumont
@@ -13,15 +13,15 @@ ms.workload:
1313
---
1414
# How to: Insert XML comments for documentation generation
1515

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.
1717

1818
> [!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.
2020
2121
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.
2222

2323
> [!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.
2525
2626
## To insert XML comments for a code element
2727

@@ -47,15 +47,14 @@ The compiler-generated XML file can be distributed alongside your .NET assembly
4747

4848
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.
4949

50-
![Screenshot showing the completed comment with style tags for italics, bold, bullets, and a clickable link.](media/doc-style-cs.png)
50+
![Screenshot showing the completed comment with style tags for italics, bold, bullets, and a clickable link.](media/doc-style-cs.png)
5151

5252
> [!NOTE]
5353
> 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.
5454
5555
## See also
5656

57-
- [XML documentation comments (C# Programming Guide)](/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments)
58-
- [Documenting your code with XML comments (C# Guide)](/dotnet/csharp/codedoc)
57+
- [Documenting your code with XML comments (C# Guide)](/dotnet/csharp/language-reference/xmldoc/)
5958
- [How to: Create XML documentation (Visual Basic)](/dotnet/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation)
6059
- [C++ Comments](/cpp/cpp/comments-cpp)
6160
- [XML Documentation (C++)](/cpp/build/reference/xml-documentation-visual-cpp)

docs/ide/reference/options-text-editor-csharp-advanced.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ Use the **Advanced** options page to modify the settings for editor formatting,
8484
using System.Linq;
8585
```
8686

87-
::: moniker range=">=vs-2019"
87+
::: moniker range=">=vs-2019"
8888
- Suggest usings for types in .NET Framework assemblies
8989
::: moniker-end
90-
91-
::: moniker range="vs-2017"
90+
91+
::: moniker range="vs-2017"
9292
- Suggest usings for types in reference assemblies
93-
::: moniker-end
93+
::: moniker-end
9494

9595
- Suggest usings for types in NuGet packages
9696

@@ -132,25 +132,25 @@ Select these check boxes to display dotted vertical lines between the curly brac
132132

133133
- Generate XML documentation comments for ///
134134

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/).
136136

137137
::: moniker range=">=vs-2019"
138138

139139
## Inline Hints
140140

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+
145145
![Inline Parameter Name Hints for CSharp](media/inline-parameter-name-hints-csharp.png)
146146

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+
151151
![Inline Type Hints for CSharp](media/inline-type-hints-csharp.png)
152152

153-
## Inheritance Margin
153+
## Inheritance Margin
154154

155155
- 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.
156156

@@ -161,7 +161,6 @@ Select these check boxes to display dotted vertical lines between the curly brac
161161
## See also
162162

163163
- [How to: Insert XML comments for documentation generation](../../ide/reference/generate-xml-documentation-comments.md)
164-
- [XML Documentation Comments (C# Programming Guide)](/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments)
165-
- [Document your code with XML comments (C# Guide)](/dotnet/csharp/codedoc)
164+
- [Document your code with XML comments (C# Guide)](/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments)
166165
- [Set language-specific editor options](../../ide/reference/setting-language-specific-editor-options.md)
167166
- [C# IntelliSense](../../ide/visual-csharp-intellisense.md)

0 commit comments

Comments
 (0)