Compiling a program from the command line
csc prog.cs
The Main method:
static void Main( )
static int Main( )
static void Main( string[] args )
static int Main( string[] args )
{
if( args.Length == 0 ) {
}
}
- The Main method is declared inside a class or a struct
- Main must be static
- Main should not be public
- The containing class or struct doesn't need to be static
- args[0] is the first parameter, not the program name.
- A program can have more than one class containing a Main method. However, only one can be chosen as the entry point ( /main compiler option)
long aliases Int64