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

Conversation

shethaadit
Copy link
Contributor

@shethaadit shethaadit commented Jul 15, 2025

Summary

This PR addresses issue #47299 by updating the documentation for the <inheritdoc> tag to clarify the difference between Visual Studio's automatic inheritance behavior and the compiler's XML output behavior.

Changes made

  • Added a note to the <inheritdoc> section explaining that Visual Studio automatically inherits documentation for undocumented members in IntelliSense and Quick Info
  • Clarified that this automatic inheritance only applies within the Visual Studio IDE
  • Emphasized that the compiler doesn't automatically include inherited documentation in the generated XML file
  • Provided guidance on when to explicitly use <inheritdoc> (for distributed libraries) vs when you can rely on VS's automatic behavior (for internal projects)

Why this change is needed

The current documentation doesn't mention Visual Studio's automatic inheritance feature introduced in VS 2019 16.4, leading developers to unnecessarily add <inheritdoc> tags to all inherited members. This update provides clarity on when the tag is actually needed.

The note is placed immediately after the cref and path parameter descriptions to provide context about the different behaviors developers might encounter.

Fixes #47299


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/xmldoc/recommended-tags.md Recommended XML tags for C# documentation comments

@shethaadit shethaadit requested review from BillWagner and a team as code owners July 15, 2025 22:18
@dotnetrepoman dotnetrepoman bot added this to the July 2025 milestone Jul 15, 2025
@dotnet-policy-service dotnet-policy-service bot added dotnet-csharp/svc lang-reference/subsvc community-contribution Indicates PR is created by someone from the .NET community. labels Jul 15, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shethaadit

This LGTM, and I'll :shipit: now.

@BillWagner BillWagner enabled auto-merge (squash) July 16, 2025 14:48
@BillWagner BillWagner merged commit a6f277f into dotnet:main Jul 16, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc lang-reference/subsvc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content for inheritdoc tag is outdated. It hasn't been updated since the changes in VS 2019 16.4 to automatically inherit documentation.
2 participants