Skip to content

Add diagnostics for Main and top level statements - #52598

Merged
BillWagner merged 11 commits into
dotnet:mainfrom
BillWagner:top-level-main
Mar 25, 2026
Merged

Add diagnostics for Main and top level statements#52598
BillWagner merged 11 commits into
dotnet:mainfrom
BillWagner:top-level-main

Conversation

@BillWagner

@BillWagner BillWagner commented Mar 23, 2026

Copy link
Copy Markdown
Member

Fix build warnings.
@BillWagner
BillWagner marked this pull request as ready for review March 23, 2026 21:04
@BillWagner
BillWagner requested a review from a team as a code owner March 23, 2026 21:04
Copilot AI review requested due to automatic review settings March 23, 2026 21:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates C# compiler diagnostics related to program entry points into a single guidance article, including Main method rules, the StartupObject (/main) option, and top-level statement diagnostics, and updates navigation and redirects accordingly.

Changes:

  • Add a new consolidated article for entry point–related diagnostics (Main, StartupObject, and top-level statements).
  • Remove older per-diagnostic pages that are now covered by the consolidated article, and update redirects and TOC entries.
  • Update the “no specifics” catch-all page to remove diagnostics that now have dedicated guidance.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/csharp/language-reference/compiler-messages/entry-point-errors.md New consolidated guidance for entry point diagnostics (Main/StartupObject/top-level statements).
docs/csharp/language-reference/toc.yml Adds a “Program entry point” node and removes TOC entries for deleted per-diagnostic pages.
.openpublishing.redirection.csharp.json Adds redirects from deleted per-diagnostic pages to the consolidated article.
docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md Removes F1 keywords for diagnostics that are now covered by the consolidated article.
docs/csharp/misc/cs0017.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs0028.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs0402.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs1555.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs1556.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs1557.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs1558.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs1559.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs2017.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/misc/cs5001.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/language-reference/compiler-messages/cs8802.md Deleted (content consolidated into entry-point-errors.md).
docs/csharp/language-reference/compiler-messages/cs8803.md Deleted (content consolidated into entry-point-errors.md).

Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
BillWagner and others added 3 commits March 23, 2026 17:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@BillWagner BillWagner closed this Mar 23, 2026
@BillWagner BillWagner reopened this Mar 23, 2026
@BillWagner

Copy link
Copy Markdown
Member Author

Let's try closing / reopening again

Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
Comment thread docs/csharp/language-reference/compiler-messages/entry-point-errors.md Outdated
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
@BillWagner
BillWagner enabled auto-merge (squash) March 25, 2026 13:19
@BillWagner
BillWagner merged commit 4b5079f into dotnet:main Mar 25, 2026
9 checks passed
@BillWagner
BillWagner deleted the top-level-main branch March 25, 2026 13:27
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.

3 participants