Show/Hide Toolbars

XSharp

This option specifies the class that contains the entry point to the program, if more than one class contains a Main method.

Syntax

-main:class  

Arguments

classThe type that contains the Main method.

Remarks

If your compilation includes more than one type with a Main method, you can specify which type contains the Main method that you want to use as the entry point into the program.

 

This option is for use when compiling an .exe file.

 

To set this compiler option in the Visual Studio development environment

1.Open the project's Properties page.

2.Click the Application property page.

3.Modify the Startup object property.

4.Click here to see the property page

 

To set this compiler option programmatically, see StartupObject.

Example

 

 

Compile t2.prg and t3.prg, specifying that the Main method will be found in Test2:

 

 

xsc t2.prg t3.prg -main:Test2