The following compiler options are sorted by category.
Optimization
Option | Purpose |
---|---|
/optimize | Enable/disable optimizations. |
Output Files
Option | Purpose |
---|---|
/doc | Process documentation comments to an XML file. |
/out | Specify output file. |
/nooutput | Compile but do not create an output file. |
/target | Specify the format of the output file using one of four options: /target:exe /target:library /target:module /target:winexe. |
NGWS Assemblies
Option | Purpose |
---|---|
/addmodule | Specify one or more modules to be part of this assembly. |
/nostdlib | Do not import standard library (mscorlib.dll). |
/reference | Import metadata from a file that contains an assembly. |
Debugging/Error Checking
Option | Purpose |
---|---|
/bugreport | Create a file that contains information that makes it easy to report a bug. |
/checked | Specify whether integer arithmetic that overflows the bounds of the data type will cause an exception at run time. |
/debug | Emit debugging information. |
/fullpaths | Specify the absolute path to the file in compiler output. |
/nowarn | Suppress the compiler’s ability to generate specified warnings. |
/warn | Set warning level. |
/warnaserror | Promote warnings to errors. |
Preprocessor
Option | Purpose |
---|---|
/define | Define preprocessor symbols. |
Resources
Option | Purpose |
---|---|
/linkresource | Link a NGWS resource to an assembly. |
/resource | Embed a NGWS resource into the output file. |
/win32icon | Insert a .ico file into the output file. |
/win32res | Insert a Win32 resource into the output file. |
Miscellaneous
Option | Purpose |
---|---|
@ | Specify a response file. |
/? | List compiler options to stdout. |
/baseaddress | Specify the base address of a DLL. |
/codepage | Specify the code page to use for all source code files in the compilation. |
/help | List compiler options to stdout. |
/incremental | Enable incremental compilation of source code files. |
/main | Specify the location of the Main method. |
/nologo | Suppress compiler banner information. |
/recurse | Search subdirectories for source files to compile. |
/unsafe | Compile code that uses the unsafe keyword. |
C# Compiler Options | C# Compiler Options Listed Alphabetically | Building from the Command Line