Skip to content

Clarify StartupObject documentation: when it's needed and qualification requirements #47726

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

The documentation for the StartupObject compiler option was misleading about when the option is actually needed and how qualification works.

Issues Fixed

  1. Misleading requirement description: The documentation implied StartupObject was only used when there are multiple Main methods, but didn't clarify that it's actually ignored when there's exactly one acceptable Main method.

  2. Unclear qualification requirements: The documentation stated the class name "must be fully qualified" without explaining that this only applies when the option is actually required (multiple Main methods exist).

  3. Missing global namespace scenario: No explanation of how fully qualified names work when the class is in the global namespace.

Changes Made

  • Clarified that StartupObject is only needed "when your compilation includes more than one type with a Main method"
  • Added explicit statement: "When there's exactly one acceptable Main method in the project, this option is ignored"
  • Updated qualification requirement to: "When this option is required (multiple Main methods exist), the provided class name must be fully qualified"
  • Added explanation for global namespace: "If the class is in the global namespace, the fully qualified name is the same as the simple class name"

The documentation now accurately reflects the compiler behavior as clarified by @BillWagner in the issue comments.

Fixes #33547.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/compiler-options/advanced.md docs/csharp/language-reference/compiler-options/advanced

…fication requirements

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] StartupObject does not appear to need to be fully qualified Clarify StartupObject documentation: when it's needed and qualification requirements Aug 4, 2025
@Copilot Copilot AI requested a review from BillWagner August 4, 2025 20:04
Copilot finished work on behalf of BillWagner August 4, 2025 20:04
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.

This is ready for final review.

@BillWagner BillWagner marked this pull request as ready for review August 5, 2025 14:49
@BillWagner BillWagner requested a review from a team as a code owner August 5, 2025 14:49
@BillWagner BillWagner requested a review from tdykstra August 5, 2025 14:49
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-csharp/svc lang-reference/subsvc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StartupObject does not appear to need to be fully qualified
2 participants