NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

/target:exe (Create Console Application)

/target:exe

Remarks

The /target:exe option causes the compiler to create an executable (EXE), console application. The /target:exe option is in effect by default. The executable file will be created with the .exe extension.

Use /target:winexe to create a Windows program executable.

Unless otherwise specified with the /out option, the output file name takes the name of the input file that contains the Main method.

When specified at the command line, all files up to the next /out, /target:winexe, or /target:dll option are used to create the .exe. The /target:exe option is in effect for all files since the previous /out or /target:dll option.

One and only one Main method is required in the source code files that are compiled into a .exe. The /main compiler option lets you specify which class contains the Main method, in cases where your code has more than one class with a Main method.

Example

Each of the following command lines will compile in.cs, creating in.exe:

csc /target:exe in.cs
csc in.cs

See Also

/target (Specify Output File Format) | C# Compiler Options