Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/xmldoc/code-inline.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ms.assetid: aad5b16e-a29e-445e-bd0d-eea0b138d7b2

## Remarks

The \<c> tag gives you a way to indicate that text within a description should be marked as code. Use [\<code>](./code.md) to indicate multiple lines as code.
The `<c>` tag gives you a way to indicate that text within a description should be marked as code. Use [\<code>](./code.md) to indicate multiple lines as code.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/programming-guide/xmldoc/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ ms.assetid: f235e3bc-a709-43cf-8a9f-bd57cabdf6da

## Remarks

The \<code> tag gives you a way to indicate multiple lines as code. Use [\<c>](./code-inline.md) to indicate that text within a description should be marked as code.
The `<code>` tag is used to indicate multiple lines of code. Use [\<c>](./code-inline.md) to indicate that single-line text within a description should be marked as code.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

## Example

See the [\<example>](./example.md) topic for an example of how to use the \<code> tag.
See the [\<example>](./example.md) article for an example of how to use the `<code>` tag.

## See also

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ The use of XML doc comments requires delimiters, which indicate to the compiler

- `///`

Single-line delimiter. This is the form that is shown in documentation examples and used by the Visual C# project templates. If there is a white space character following the delimiter, that character is not included in the XML output.
Single-line delimiter. This is the form that is shown in documentation examples and used by the C# project templates. If there is a white space character following the delimiter, that character is not included in the XML output.

> [!NOTE]
> The Visual Studio IDE has a feature called Smart Comment Editing that automatically inserts the \<summary> and \</summary> tags and moves your cursor within these tags after you type the `///` delimiter in the Code Editor. You can turn this feature on or off in the [Options dialog box](/visualstudio/ide/reference/options-text-editor-csharp-advanced).
> The Visual Studio integrated development environment (IDE) automatically inserts the `<summary>` and `</summary>` tags and moves your cursor within these tags after you type the `///` delimiter in the code editor. You can turn this feature on or off in the [Options dialog box](/visualstudio/ide/reference/options-text-editor-csharp-advanced).

- `/** */`

Expand All @@ -26,13 +26,13 @@ The use of XML doc comments requires delimiters, which indicate to the compiler

- On the line that contains the `/**` delimiter, if the remainder of the line is white space, the line is not processed for comments. If the first character after the `/**` delimiter is white space, that white space character is ignored and the rest of the line is processed. Otherwise, the entire text of the line after the `/**` delimiter is processed as part of the comment.

- On the line that contains the `*/` delimiter, if there is only white space up to the `*/` delimiter, that line is ignored. Otherwise, the text on the line up to the `*/` delimiter is processed as part of the comment, subject to the pattern-matching rules described in the following bullet.
- On the line that contains the `*/` delimiter, if there is only white space up to the `*/` delimiter, that line is ignored. Otherwise, the text on the line up to the `*/` delimiter is processed as part of the comment.

- For the lines after the one that begins with the `/**` delimiter, the compiler looks for a common pattern at the beginning of each line. The pattern can consist of optional white space and an asterisk (`*`), followed by more optional white space. If the compiler finds a common pattern at the beginning of each line that does not begin with the `/**` delimiter or the `*/` delimiter, it ignores that pattern for each line.

The following examples illustrate these rules.

- The only part of the following comment that will be processed is the line that begins with `<summary>`. The three tag formats produce the same comments.
- The only part of the following comment that's processed is the line that begins with `<summary>`. The three tag formats produce the same comments.

```csharp
/** <summary>text</summary> */
Expand Down Expand Up @@ -71,7 +71,7 @@ The use of XML doc comments requires delimiters, which indicate to the compiler
* <summary>
* text
* text2
* </summary>
* </summary>
*/
```
<!-- markdownlint-enable MD010 -->
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/xmldoc/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ms.assetid: 32d6e73b-2554-4abb-83ee-a1e321334fd2

## Remarks

The \<example> tag lets you specify an example of how to use a method or other library member. This commonly involves using the [\<code>](./code.md) tag.
The `<example>` tag lets you specify an example of how to use a method or other library member. This commonly involves using the [\<code>](./code.md) tag.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/xmldoc/exception.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ms.assetid: dd73aac5-3c74-4fcf-9498-f11bff3a2f3c

## Remarks

The \<exception> tag lets you specify which exceptions can be thrown. This tag can be applied to definitions for methods, properties, events, and indexers.
The `<exception>` tag lets you specify which exceptions can be thrown. This tag can be applied to definitions for methods, properties, events, and indexers.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,28 @@ The example generates an *.xml* file with the following contents.

## Compiling the code

To compile the example, type the following command line:
To compile the example, enter the following command:

`csc XMLsample.cs /doc:XMLsample.xml`

This command creates the XML file *XMLsample.xml*, which you can view in your browser or by using the TYPE command.
This command creates the XML file *XMLsample.xml*, which you can view in your browser or by using the `TYPE` command.

## Robust programming

XML documentation starts with ///. When you create a new project, the wizards put some starter /// lines in for you. The processing of these comments has some restrictions:
XML documentation starts with `///`. When you create a new project, the wizards put some starter `///` lines in for you. The processing of these comments has some restrictions:

- The documentation must be well-formed XML. If the XML is not well-formed, a warning is generated and the documentation file will contain a comment that says that an error was encountered.

- Developers are free to create their own set of tags. There is a [recommended set of tags](recommended-tags-for-documentation-comments.md). Some of the recommended tags have special meanings:

- The \<param> tag is used to describe parameters. If used, the compiler verifies that the parameter exists and that all parameters are described in the documentation. If the verification failed, the compiler issues a warning.
- The `<param>` tag is used to describe parameters. If used, the compiler verifies that the parameter exists and that all parameters are described in the documentation. If the verification fails, the compiler issues a warning.

- 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 failed, the compiler issues a warning. The compiler respects any `using` statements when it looks for a type described in the `cref` attribute.
- The `cref` attribute can be attached to any tag to reference a code element. The compiler verifies that this code element exists. If the verification fails, the compiler issues a warning. The compiler respects any `using` statements when it looks for a type described in the `cref` attribute.

- The \<summary> tag is used by IntelliSense inside Visual Studio to display additional information about a type or member.
- The `<summary>` tag is used by IntelliSense inside Visual Studio to display additional information about a type or member.

> [!NOTE]
> The XML file does not provide full information about the type and members (for example, it does not contain any type information). To get full information about a type or member, the documentation file must be used together with reflection on the actual type or member.
> The XML file does not provide full information about the type and members (for example, it does not contain any type information). To get full information about a type or member, use the documentation file together with reflection on the actual type or member.

## See also

Expand Down
8 changes: 4 additions & 4 deletions docs/csharp/programming-guide/xmldoc/include.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ The ID for the tag that precedes the comments. Enclose the ID in double quotatio

## Remarks

The \<include> tag lets you refer to comments in another file that describe the types and members in your source code. This is an alternative to placing documentation comments directly in your source code file. By putting the documentation in a separate file, you can apply source control to the documentation separately from the source code. One person can have the source code file checked out and someone else can have the documentation file checked out.
The `<include>` tag lets you refer to comments in another file that describe the types and members in your source code. This is an alternative to placing documentation comments directly in your source code file. By putting the documentation in a separate file, you can apply source control to the documentation separately from the source code. One person can have the source code file checked out and someone else can have the documentation file checked out.

The \<include> tag uses the XML XPath syntax. Refer to XPath documentation for ways to customize your \<include> use.
The `<include>` tag uses the XML XPath syntax. Refer to XPath documentation for ways to customize your `<include>` use.

## Example

This is a multifile example. The following is the first file, which uses \<include>.
This is a multifile example. The following is the first file, which uses `<include>`.

[!code-csharp[csProgGuideDocComments#5](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideDocComments/CS/DocComments.cs#5)]

Expand All @@ -69,7 +69,7 @@ The summary for this other type.

## Program output

The following output is generated when you compile the Test and Test2 classes with the following command line: `-doc:DocFileName.xml.` In Visual Studio, you specify the XML doc comments option in the Build pane of the Project Designer. When the C# compiler sees the \<include> tag, it will search for documentation comments in xml_include_tag.doc instead of the current source file. The compiler then generates DocFileName.xml, and this is the file that is consumed by documentation tools such as [DocFX](https://dotnet.github.io/docfx/) and [Sandcastle](https://github.com/EWSoftware/SHFB) to produce the final documentation.
The following output is generated when you compile the Test and Test2 classes with the following command line: `-doc:DocFileName.xml.` In Visual Studio, you specify the XML doc comments option in the Build pane of the Project Designer. When the C# compiler sees the `<include>` tag, it searches for documentation comments in *xml_include_tag.doc* instead of the current source file. The compiler then generates *DocFileName.xml*, and this is the file that is consumed by documentation tools such as [DocFX](https://dotnet.github.io/docfx/) and [Sandcastle](https://github.com/EWSoftware/SHFB) to produce the final documentation.

```xml
<?xml version="1.0"?>
Expand Down
6 changes: 3 additions & 3 deletions docs/csharp/programming-guide/xmldoc/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ ms.assetid: c9620b1b-c2e6-43f1-ab88-8ab47308ffec

## Remarks

The \<listheader> block is used to define the heading row of either a table or definition list. When defining a table, you only need to supply an entry for term in the heading.
The `<listheader>` block is used to define the heading row of either a table or definition list. When defining a table, you only need to supply an entry for term in the heading.

Each item in the list is specified with an \<item> block. When creating a definition list, you will need to specify both `term` and `description`. However, for a table, bulleted list, or numbered list, you only need to supply an entry for `description`.
Each item in the list is specified with an `<item>` block. When creating a definition list, you will need to specify both `term` and `description`. However, for a table, bulleted list, or numbered list, you only need to supply an entry for `description`.

A list or table can have as many \<item> blocks as needed.
A list or table can have as many `<item>` blocks as needed.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/programming-guide/xmldoc/para.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ ms.assetid: c74b8705-29df-40b1-bff5-237492b0e978

## Remarks

The \<para> tag is for use inside a tag, such as [\<summary>](./summary.md), [\<remarks>](./remarks.md), or [\<returns>](./returns.md), and lets you add structure to the text.
The `<para>` tag is for use inside a tag, such as [\<summary>](./summary.md), [\<remarks>](./remarks.md), or [\<returns>](./returns.md), and lets you add structure to the text.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

## Example

See [\<summary>](./summary.md) for an example of using \<para>.
See [\<summary>](./summary.md) for an example of using `<para>`.

## See also

Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/programming-guide/xmldoc/param.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ ms.assetid: 46d329b1-5b84-4537-9e17-73ca97313e4e

## Remarks

The \<param> tag should be used in the comment for a method declaration to describe one of the parameters for the method. To document multiple parameters, use multiple \<param> tags.
The `<param>` tag should be used in the comment for a method declaration to describe one of the parameters for the method. To document multiple parameters, use multiple `<param>` tags.

The text for the \<param> tag will be displayed in IntelliSense, the Object Browser, and in the Code Comment Web Report.
The text for the `<param>` tag is displayed in IntelliSense, the Object Browser, and the Code Comment Web Report.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/xmldoc/paramref.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ms.assetid: 756c24c1-f591-40e8-a838-559761539b0b

## Remarks

The \<paramref> tag gives you a way to indicate that a word in the code comments, for example in a \<summary> or \<remarks> block refers to a parameter. The XML file can be processed to format this word in some distinct way, such as with a bold or italic font.
The `<paramref>` tag gives you a way to indicate that a word in the code comments, for example in a `<summary>` or `<remarks>` block refers to a parameter. The XML file can be processed to format this word in some distinct way, such as with a bold or italic font.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/xmldoc/permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ms.assetid: 769e93fe-8404-443f-bf99-577aa42b6a49

## Remarks

The \<permission> tag lets you document the access of a member. The <xref:System.Security.PermissionSet> class lets you specify access to a member.
The `<permission>` tag lets you document the access of a member. The <xref:System.Security.PermissionSet> class lets you specify access to a member.

Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.

Expand Down
Loading