Skip to content

Clarify behavior for suppressing warnings against inner namespaces.#12896

Open
Justin-Nietzel wants to merge 2 commits into
dotnet:mainfrom
Justin-Nietzel:patch-1
Open

Clarify behavior for suppressing warnings against inner namespaces.#12896
Justin-Nietzel wants to merge 2 commits into
dotnet:mainfrom
Justin-Nietzel:patch-1

Conversation

@Justin-Nietzel

Copy link
Copy Markdown

Summary

Suppressing warnings against a namespace does not suppress warnings against inner namespaces, i.e. namespaces that share all namespace segments with suppressed namespace. I found this behavior to be unintuitive and wanted to update the documentation to help other people with the same confusion.

I spent a bit of time reading over the C# language specification trying to find the best term to describe namespaces that are part of another namespace. Let me know if there are any preferred terms for them.

Inspired by dotnet/roslyn#83728

Suppressing warnings against a namespace does not suppress warnings against inner namespaces, i.e. namespaces that share all namespace segments with suppressed namespace.
@Justin-Nietzel
Justin-Nietzel requested a review from a team as a code owner July 22, 2026 20:13
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 22, 2026
Comment thread xml/System.Diagnostics.CodeAnalysis/SuppressMessageAttribute.xml Outdated
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Diagnostics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants