Skip to content

Update <inheritdoc> documentation to clarify Visual Studio vs compiler behavior #47382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025
Merged
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
5 changes: 5 additions & 0 deletions docs/csharp/language-reference/xmldoc/recommended-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ Inherit XML comments from base classes, interfaces, and similar methods. Using `
- `cref`: Specify the member to inherit documentation from. Already defined tags on the current member aren't overridden by the inherited ones.
- `path`: The XPath expression query that results in a node set to show. You can use this attribute to filter the tags to include or exclude from the inherited documentation.

> [!NOTE]
> Visual Studio provides automatic inheritance of XML documentation for undocumented members that override or implement documented members. This feature displays inherited documentation in IntelliSense and Quick Info without requiring the `<inheritdoc>` tag. However, this automatic inheritance only applies within the Visual Studio IDE and doesn't affect the XML documentation file generated by the compiler.
>
> For public APIs in libraries that you distribute, you should explicitly use the `<inheritdoc>` tag or provide complete documentation to ensure the generated XML documentation file includes all necessary information for consumers of your library.

Add your XML comments in base classes or interfaces and let inheritdoc copy the comments to implementing classes. Add your XML comments to your synchronous methods and let inheritdoc copy the comments to your asynchronous versions of the same methods. If you want to copy the comments from a specific member, you use the `cref` attribute to specify the member.

### \<include>
Expand Down
Loading