/target:winexe (C# Compiler Options)
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
The /target:winexe option causes the compiler to create an executable (EXE), Windows program.
The executable file will be created with the .exe extension. A Windows program is one that provides a user interface from either the .NET Framework library or with the Win32 APIs.
Use /target:exe to create a console application.
When specified at the command line, all files until the next /out or /target option are used to create the Windows program.
One and only one Main method is required in the source code files that are compiled into an .exe file. The /main option lets you specify which class contains the Main method, in cases where your code has more than one class with a Main method.
Open the project's Properties page.
Click the Application property page.
Modify the Output type property.
For information on how to set this compiler option programmatically, see OutputType.
in.cs into a Windows program:
csc /target:winexe in.cs