C# Compiler Options Listed Alphabetically
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

C# Compiler Options Listed Alphabetically 

The following compiler options are sorted alphabetically. For a categorical list, see C# Compiler Options Listed By Category.

Option Purpose

@

Reads a response file for more options.

/?

Displays a usage message to stdout.

/addmodule

Links the specified modules into this assembly

/baseaddress

Specifies the base address for the library to be built.

/bugreport

Creates a 'Bug Report' file. This file will be sent along with any crash information if used with /errorreport:prompt or /errorreport:send.

/checked

Causes the compiler to generate overflow checks.

/codepage

Specifies the codepage to use when opening source files.

/debug

Emits debugging information.

/define

Defines conditional compilation symbols.

/delaysign

Delay-signs the assembly using only the public portion of the strong name key.

/doc

Specifies an XML Documentation file to generate.

/errorreport

Specifies how to handle internal compiler errors: prompt, send, or none. The default is none.

/filealign

Specifies the alignment used for output file sections.

/fullpaths

Causes the compiler to generate fully qualified paths.

/help

Displays a usage message to stdout.

/incremental

Enables incremental compilation [obsolete].

/keycontainer

Specifies a strong name key container.

/keyfile

Specifies a strong name key file.

/langversion

Specifies language version modes: ISO-1 or Default.

/lib

Specify additional directories to search in for references.

/linkresource

Links the specified resource to this assembly.

/main

Specifies the type that contains the entry point (ignore all other possible entry points).

/noconfig

Instructs the compiler not to auto include CSC.RSP file.

/nologo

Suppresses compiler copyright message.

/nostdlib

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

/nowarn

Disables specific warning messages

/optimize

Enables/disables optimizations.

/out

Specifies the output file name (default: base name of file with main class or first file).

/pdb

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

/platform

Limits which platforms this code can run on: x86, Itanium, x64, or anycpu. The default is anycpu.

/recurse

Includes all files in the current directory and subdirectories according to the wildcard specifications.

/reference

References metadata from the specified assembly files.

/resource

Embeds the specified resource.

/target

Specifies the format of the output file using one of four options:/target:exe/target:library/target:module/target:winexe

/unsafe

Allows unsafe code.

/utf8output

Outputs compiler messages in UTF-8 encoding.

/warn

Sets the warning level (0-4).

/warnaserror

Reports specific warnings as errors.

/win32icon

Uses this icon for the output.

/win32res

Specifies the Win32 resource file (.res).

Show:
© 2016 Microsoft