C# Compiler Options Listed by Category

C# Compiler Options Listed by Category


The following compiler options are sorted by category. For an alphabetical list, see C# Compiler Options Listed Alphabetically.





Specifies the size of sections in the output file.


Enables/disables optimizations.

Output Files




Specifies an XML file where processed documentation comments are to be written.


Specifies the output file.


Specifies the file name and location of the .pdb file.


Specify the output platform.


Specify a language for compiler output.


Specifies the format of the output file using one of five options: /target:appcontainerexe, /target:exe, /target:library, /target:module, /target:winexe, or /target:winmdobj.


Specify the name of the source module

.NET Framework Assemblies




Specifies one or more modules to be part of this assembly.


Instructs the compiler to add the public key but to leave the assembly unsigned.


Specifies the name of the cryptographic key container.


Specifies the filename containing the cryptographic key.


Specifies the location of assemblies referenced by means of /reference.


Instructs the compiler not to import the standard library (mscorlib.dll).


Imports metadata from a file that contains an assembly.


Run the analyzers from this assembly (Short form: /a)


Names additional files that don't directly affect code generation but may be used by analyzers for producing errors or warnings.

Debugging/Error Checking




Creates a file that contains information that makes it easy to report a bug.


Specifies whether integer arithmetic that overflows the bounds of the data type will cause an exception at run time.


Instruct the compiler to emit debugging information.


Sets error reporting behavior.


Specifies the absolute path to the file in compiler output.


Suppresses the compiler's generation of specified warnings.


Sets the warning level.


Promotes warnings to errors.


Specify a ruleset file that disables specific diagnostics.





Defines preprocessor symbols.





Makes COM type information in specified assemblies available to the project.


Creates a link to a managed resource.


Embeds a .NET Framework resource into the output file.


Specifies an .ico file to insert into the output file.


Specifies a Win32 resource to insert into the output file.





Specifies a response file.


Lists compiler options to stdout.


Specifies the preferred base address at which to load a DLL.


Specifies the code page to use for all source code files in the compilation.


Lists compiler options to stdout.


Specifies that the executable file supports address space layout randomization (ASLR).


Specify language version mode: ISO-1, ISO-2, 3, 4, 5, 6, or Default


Specifies the location of the Main method.


Instructs the compiler not to compile with csc.rsp.


Suppresses compiler banner information.


Searches subdirectories for source files to compile.


Specifies the minimum version of the subsystem that the executable file can use.


Enables compilation of code that uses the unsafe keyword.


Displays compiler output using UTF-8 encoding.


Specifies whether to use concurrent build (+).


Specify the algorithm for calculating the source file checksum stored in PDB. Supported values are: SHA1 (default) or SHA256.


Enables incremental compilation.

© 2015 Microsoft