diff --git a/docs/csharp/language-reference/compiler-options/advanced.md b/docs/csharp/language-reference/compiler-options/advanced.md index fb37e22e45914..91311790d5ad2 100644 --- a/docs/csharp/language-reference/compiler-options/advanced.md +++ b/docs/csharp/language-reference/compiler-options/advanced.md @@ -56,13 +56,13 @@ You add any of these options in a `` element in your `*.csproj` f ## StartupObject -This option specifies the class that contains the entry point to the program, if more than one class contains a `Main` method. +This option specifies the class that contains the entry point to the program when your project includes more than one type with a `Main` method. When there's exactly one acceptable `Main` method in the project, this option is ignored. ```xml MyNamespace.Program ``` -Where `Program` is the type that contains the `Main` method. The class name can be either fully qualified (including the namespace) or just the class name if it's unambiguous. For example, when the `Main` method is located inside the `Program` class in the `MyApplication.Core` namespace, you can specify either `-main:MyApplication.Core.Program` or just `-main:Program` if there's no ambiguity. If your compilation includes more than one type with a [`Main`](../../fundamentals/program-structure/main-command-line.md) method, you can specify which type contains the `Main` method. +Where `Program` is the type that contains the `Main` method. When this option is required (multiple `Main` methods exist), the provided class name must be fully qualified; it must include the full namespace containing the class, followed by the class name. For example, when the `Main` method is located inside the `Program` class in the `MyApplication.Core` namespace, the compiler option has to be `-main:MyApplication.Core.Program`. If the class is in the global namespace, the fully qualified name is the same as the simple class name (for example, `Program` instead of `MyNamespace.Program`). > [!NOTE] > This option can't be used for a project that includes [top-level statements](../../fundamentals/program-structure/top-level-statements.md), even if that project contains one or more `Main` methods.