Skip to content

Conversation

@BillWagner
Copy link
Member

@BillWagner BillWagner commented Feb 9, 2026

Fixes #51445

Add the undocumented diagnostics related to file-scoped namespace declarations.

While working in this area, pick up the undocumented errors related to global usings and other aliases.

Finally, do a complete edit pass to focus more on resolving the issues than describing them.


Internal previews

📄 File 🔗 Preview link
docs/core/compatibility/windows-forms/10.0/menuitem-contextmenu.md Applications referencing both WPF and WinForms must disambiguate MenuItem and ContextMenu types
docs/csharp/language-reference/compiler-messages/using-directive-errors.md Resolve warnings related to using and declaring namespaces
docs/csharp/language-reference/toc.yml docs/csharp/language-reference/toc
docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md Coming in C# 15

@BillWagner BillWagner marked this pull request as ready for review February 9, 2026 16:06
@BillWagner BillWagner requested review from a team and gewarren as code owners February 9, 2026 16:06
Copilot AI review requested due to automatic review settings February 9, 2026 16:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Consolidates documentation for compiler diagnostics related to using directives, aliases, and file-scoped namespaces by moving previously separate error pages into a single “using directive errors” article and updating navigation/redirects accordingly.

Changes:

  • Expanded using-directive-errors.md to include additional diagnostics (file-scoped namespace, extern alias, global using, alias restrictions).
  • Removed several older per-error docs/csharp/misc/cs*.md pages and added redirects to the consolidated article.
  • Updated TOC and a related WinForms compatibility doc to point at the consolidated content.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md Removes error codes that are now documented elsewhere.
docs/csharp/misc/cs2034.md Removes standalone CS2034 page (now consolidated).
docs/csharp/misc/cs1730.md Removes standalone CS1730 page (now consolidated).
docs/csharp/misc/cs1681.md Removes standalone CS1681 page (now consolidated).
docs/csharp/misc/cs1680.md Removes standalone CS1680 page (now consolidated).
docs/csharp/misc/cs1679.md Removes standalone CS1679 page (now consolidated).
docs/csharp/misc/cs1671.md Removes standalone CS1671 page (now consolidated).
docs/csharp/misc/cs0439.md Removes standalone CS0439 page (now consolidated).
docs/csharp/misc/cs0430.md Removes standalone CS0430 page (now consolidated).
docs/csharp/language-reference/toc.yml Updates navigation and display keywords to match consolidation.
docs/csharp/language-reference/compiler-messages/using-directive-errors.md Adds/rewrites content to cover additional diagnostics and guidance.
docs/csharp/language-reference/compiler-messages/snippets/UsingDirectives/UsingDirective.csproj Removes snippet project (article no longer references these snippet includes).
docs/csharp/language-reference/compiler-messages/snippets/UsingDirectives/UnsafeExamples.cs Removes snippet source file (no longer referenced).
docs/csharp/language-reference/compiler-messages/snippets/UsingDirectives/Program.cs Removes snippet source file (no longer referenced).
docs/csharp/language-reference/compiler-messages/snippets/UsingDirectives/MyClass.cs Removes snippet source file (no longer referenced).
docs/core/compatibility/windows-forms/10.0/menuitem-contextmenu.md Updates cross-link to consolidated using/alias guidance.
.openpublishing.redirection.csharp.json Adds redirects from removed per-error pages to the consolidated article.

BillWagner and others added 6 commits February 9, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#10 diagnostics] File scoped namespace declarations

1 participant