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
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,19 @@ You can distribute the compiler-generated XML file along with your .NET assembly
19
19
20
20
## Enable documentation generation
21
21
22
+
::: moniker range=">= vs-2022"
22
23
To enable documentation generation, select the **Generate a file containing API documentation** checkbox on the **Build** > **Output** tab of your project's properties.
23
24
24
25
By default, a documentation file named the same as your assembly with an *.xml* file extension generates in the same directory as the assembly. If you want to configure a nondefault name or location for the file, enter or browse to an alternate location under **XML documentation file path**.
26
+
::: moniker-end
25
27
26
-
Alternatively, you can add the [GenerateDocumentationFile](/dotnet/core/project-sdk/msbuild-props#generatedocumentationfile) or [DocumentationFile](/dotnet/core/project-sdk/msbuild-props#documentationfile) properties to your *.csproj*, *.vbproj*, or *.fsproj* file. Set `GenerateDocumentationFile` to `true` to generate a documentation file with the default name and location. Add the `DocumentationFile` property to specify a different name or location.
28
+
::: moniker range="<= vs-2019"
29
+
To enable documentation generation, select the **XML documentation file** checkbox in the **Build** > **Output** section of your project's properties.
30
+
31
+
By default, a documentation file named the same as your assembly with an *.xml* file extension generates in the same directory as the assembly. If you want to configure a nondefault name or location for the file, enter or browse to an alternate location.
32
+
::: moniker-end
33
+
34
+
Alternatively, you can add the [GenerateDocumentationFile](/dotnet/core/project-sdk/msbuild-props#generatedocumentationfile) or [DocumentationFile](/dotnet/core/project-sdk/msbuild-props#documentationfile) properties to your *.csproj*, *.vbproj*, or *.fsproj* file. Set `GenerateDocumentationFile` to `true` to generate a documentation file with the default name and location. Use the `DocumentationFile` property to specify a different name or location.
27
35
28
36
If you use `DocumentationFile` by itself or with the `GenerateDocumentationFile` property set to `true`, a documentation file with the specified name and location is generated. However, if you set `GenerateDocumentationFile` to `false`, no documentation file is generated even if you set the `DocumentationFile` property.
Copy file name to clipboardExpand all lines: docs/ide/walkthrough-creating-a-code-snippet.md
+16-6Lines changed: 16 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -90,12 +90,17 @@ You can create your own code snippets and add them to the code snippets that Vis
90
90
91
91
1. In the **Import Code Snippet** dialog box, select the **My Code Snippets** folder in the right pane. Select **Finish**, and then select **OK**.
92
92
93
-
1.The snippet is copied to one of the following locations, depending on the code language and version of Visual Studio that you're using:
93
+
The snippet is copied to one of the following locations, depending on the code language:
94
94
95
-
-*%USERPROFILE%\Documents\Visual Studio 2022\Code Snippets\Visual C#\My Code Snippets*
96
-
-*%USERPROFILE%\Documents\Visual Studio 2022\Code Snippets\Visual Basic\My Code Snippets*
97
-
-*%USERPROFILE%\Documents\Visual Studio 2019\Code Snippets\Visual C#\My Code Snippets*
98
-
-*%USERPROFILE%\Documents\Visual Studio 2019\Code Snippets\Visual Basic\My Code Snippets*
95
+
::: moniker range=">= vs-2022"
96
+
*%USERPROFILE%\Documents\Visual Studio 2022\Code Snippets\Visual C#\My Code Snippets*
97
+
*%USERPROFILE%\Documents\Visual Studio 2022\Code Snippets\Visual Basic\My Code Snippets*
98
+
::: moniker-end
99
+
100
+
::: moniker range="<= vs-2019"
101
+
*%USERPROFILE%\Documents\Visual Studio 2019\Code Snippets\Visual C#\My Code Snippets*
102
+
*%USERPROFILE%\Documents\Visual Studio 2019\Code Snippets\Visual Basic\My Code Snippets*
103
+
::: moniker-end
99
104
100
105
1. Test your snippet by opening a C# or Visual Basic project. With a code file open in the editor, take one of the following actions:
101
106
@@ -109,12 +114,17 @@ You can create your own code snippets and add them to the code snippets that Vis
109
114
110
115
The description field provides more information about your code snippet when viewed in the **Code Snippets Manager**. The shortcut is a tag you can type to insert your snippet.
111
116
112
-
1. To edit your snippet, open the snippet file from the following location, depending on the code language and version of Visual Studio that you're using:
117
+
1. To edit your snippet, open the snippet file from one of the following locations, depending on the code language:
113
118
119
+
::: moniker range=">= vs-2022"
114
120
-*%USERPROFILE%\Documents\Visual Studio 2022\Code Snippets\Visual C#\My Code Snippets/SquareRoot.snippet*
115
121
-*%USERPROFILE%\Documents\Visual Studio 2022\Code Snippets\Visual Basic\My Code Snippets/SquareRoot.snippet*
122
+
::: moniker-end
123
+
124
+
::: moniker range="<= vs-2019"
116
125
-*%USERPROFILE%\Documents\Visual Studio 2019\Code Snippets\Visual C#\My Code Snippets/SquareRoot.snippet*
117
126
-*%USERPROFILE%\Documents\Visual Studio 2019\Code Snippets\Visual Basic\My Code Snippets/SquareRoot.snippet*
127
+
::: moniker-end
118
128
119
129
> [!TIP]
120
130
> Because you're editing the file in the directory where Visual Studio placed it, you don't need to reimport it to Visual Studio.
0 commit comments