Clarify StartupObject documentation: when it's needed and qualification requirements #47726
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The documentation for the
StartupObject
compiler option was misleading about when the option is actually needed and how qualification works.Issues Fixed
Misleading requirement description: The documentation implied
StartupObject
was only used when there are multipleMain
methods, but didn't clarify that it's actually ignored when there's exactly one acceptableMain
method.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).Missing global namespace scenario: No explanation of how fully qualified names work when the class is in the global namespace.
Changes Made
StartupObject
is only needed "when your compilation includes more than one type with aMain
method"Main
method in the project, this option is ignored"Main
methods exist), the provided class name must be fully qualified"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