C# is a Compiled language. Your source code is first compiled and converted in to IL (Intermediate Language). On execution the program is converted in to normal unmanaged assembly code by the JIT (Just - in Time) compiler provided by the CLR. Given that your program exits in the context of the .Net framework and uses the .Net libraries, to compile your programs properly there are a few compiler options (switches) that you have to use. I will describe them below.

All the options with a '*' mark are used very often

Switches Use
@ * Specify a response file containing compiler options
/? , /help Show the compiler options on the Console screen.
/addmodule Specify modules to be added to the Assembly you are compiling.
/baseaddress Specify the base address at which to load a DLL.
/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.
/codepage Specify the code page to use for all source code files in the compilation.
/debug  * Emit debugging information.
/define Define preprocessor directives.
/doc  * Write a XML file containing code documentation. 
/fullpaths Specify the full path to the file in compiler error/warning output.
/incremental Enable incremental compilation of source code files.
/linkresource Link a .NET resource to an assembly.
/main Specify the location of the Main method from two or more classes.
/nologo Suppress compiler banner information shown during compilation.
/nooutput Compile but do not create an output file.
/nostdlib Do not import standard library (mscorlib.dll).
/nowarn Suppress the compiler's ability to generate specified warnings.
/optimize  Enable/disable optimizations.
/out * Specify output file name.
/recurse Search subdirectories for source files to compile.
/reference * Import metadata from a file that contains an assembly.
/resource Embed a .NET resource file into the output file.
/target  * Specify the format of the output file.
/unsafe Compile code that uses the unsafe unmanaged code.
/warn Set warning level.
/warnaserror Treat all warnings as errors.
/win32icon Insert a custom icon to the output file.
/win32res Insert a Win32 resource into the output file.

@
This option is used to specify a Response File (*.rsp) which contains all the compiler options while compiling .
The response file is a normal text file containing compiler switches, Use # to provide comments. Specify multiple Response files in this way : csc @file.rsp @file2.rsp . Options given in a Response file are similar to typing them on the command prompt. Command line options can be used with the Response File. This can come in very handy when you want to specify some common compiler options while compiling all your projects. Example: if you have to specify many Assemblies to be included in your Program a normal compile statement would span many lines, you can write a Response file containing all the common options. This will decrease the amount of options you have to type- in every time you compile.
The compiler processes the command options as they are encountered. Therefore, command line arguments can override previously listed options in response files. Conversely, options in a response file will override options listed previously on the command line or in other response files.
/? or /Help
This option will list out the compiler options on the console screen.

/addmodule

This options prompts the compiler to import the Type Information (Meta Data ) from the Modules specified into the Project you are currently compiling. Modules are made when you compile a file with option "/target:module". Modules are Dll's which contain Meta-Data but they do not have assembly manifest in it. If you (explicitly) specify any other Dll's which are not Modules then they are added to the projects assembly. Since Modules do not have assembly manifest in it, they cannot be loaded by the .NET runtime. But they can be used by importing them with the /addmodule option in your project. Two or more modules can be specified in a single statement by separating them by a comma "'," or a Semicolon ";" .

/baseaddress

This option lets you specify the preferred base address in Hexadecimal, decimal or octal form at which the .NET runtime should load you assembly. By default the base address to load a DLL is set by the .NET runtime. This option is ignored if your output file is not a Dll

/bugreport

This option is used to report compiler bugs. It contains the following information.

a) A copy of all source code files in the compilation.
b) A listing of the compiler options used in the compilation.
c) Version information about your compiler, runtime, and operating system.
d) Compiler output, if any.
e) A description of the problem, which you will be prompted to enter at the console screen.
f) A description of how you think the problem should be fixed, which you will be prompted for to enter at the console screen.

This option I guess will be only in the .NET beta stages. Use it if you find any compiler bugs!

/checked

This option specifies whether an integer arithmetic statement that is not in the scope of the checked or unchecked keywords and that results in a value outside the range of the data type shall cause a run-time exception. For example the range of the Type Int16 is up to positive 32767. If during execution a variable of Type Int16 is assigned a value greater than 32767 and if its not within the scope of the checked keyword then the variable's value will automatically made Zero and the program will execute normally. This can have drastic effects depending on the program you are writing. If its important for you to that always the right value is assigned to your variables then compile with the option "/checked". This will result in a Runtime Exception every time the variable exceeds its scope. By default the compiler compiles with the /checked- option and no Exceptions of this type are generated.

/codepage

If you compile one or more source code files that were not created to use the default code page on your computer, you can use the /codepage option to specify which code page should be used. /codepage applies to all source code files in your compilation.
If the source code files were created with the same codepage that is in effect on your computer or if the source code files were created with UNICODE or UTF-8, you do not need to use /codepage.

/debug

Debugging is where most of the time of a programmer goes...
To enable a program to be debugged in the Debugger use this option. It creates a .pdb file and places all your debugging information in it. There are 2 types of options you can specify while debugging.
/debug [+/-] : When /debug+ is specified the default debugging information is stored in a .pdb file. /debug - is the default compiler option which does not create any debugging information.
/debug:[full/pdbonly] : The default debugging information is created when /debug:full command is given. It is the same as /debug+. /debug:pdbonly option just creates a .pdb file and you can only use source code debugging in the Debugger.

/define

This option defines a symbol in your program. It has the same effect as using a #define preprocessor directive in your source file. A symbol remains defined until an #undef directive in the source file removes the definition or the compiler reaches the end of the file./d is the short form of /define. Preprocessor directives are very use full when you want to make various builds of the same program. Example: In a Application you want to make a Final Release and a Trial Version release. You can write preprocessor directives in your source code which during compilation time using /define you can define which build you want to compile.

/doc

Documentation has become one of the most important features of writing codes these days. Every good code written should be supplemented with equally good documentation. While writing your code you can document it using some special tags which follow "///". When you compile with the /doc option all the comments written in your source code will automatically be placed in a XML file.

/fullpaths

When a error or warning massage is shown while compilation it specifies only the name of the file in which an error was found. The /fullpaths option causes the compiler to specify the full path to the file. This is useful when you have distributed your code across directories or computers.

/incremental

This option enables the incremental compiler, which compiles only those functions that changed since the last compilation. Information about the state of the previous compilation is stored in the following files, which are created by the compiler:
output_file_name.dbg
When compiling with /debug, the status of debug information is stored in the .pdb file.
output_file_name.extension.incr
Information about the status of the compilation, other than debug information, is stored in a .incr file.
The first time you use /incremental, the .incr and .pdb files are updated and all subsequent compilations will be incremental. Changing the compiler options from the previous /incremental compilation will cause a full rebuild of the .incr and .pdb files.
If the compiler cannot find the project's .pdb or .incr files, a full rebuild will occur. Output files created with the /incremental option may be larger than those created with incremental compilation disabled. Because the output files can be larger, you should use /incremental- in the final build of your output file. This option will speed compilation on projects with many, smaller files, and will have little or no speed improvement on projects with fewer, large files.

/linkresource

This option creates a Link to a .NET resource in the output file. the resource file is not embedded in the output file. /linkres is the short form of /linkresource. A Resource file is a file which contains all the resources used in the project like all bitmaps, sounds etc. This option just created a link to the resource file, this helps multiple programs to use the same resource without duplication.

/main

When you are compiling two or more classes which have the Main method defined together, we use this option to specify the class from which the final output file should use the Main method.

/nologo

This option suppresses the sign-on banner (copyright information, compiler version etc) shown during compilation by the compiler. If you are compiling from the console then this is a good option to use to suppress the banner from showing up every time you compile. This option will show the errors, warnings and other information as normal.

/nooutput

This option will compile the file as normal showing errors or warnings, if any, but it will not create a output file. This option may be used when you just want to check the code for errors without generating a output file.

/nostdlib

This option prevents the mscorlib.dll from being imported in your project. the Dll mscorlib.dll contains the whole System namespace. This option is only for advanced users who have written their own version of the System namespace.

/nowarn

This option suppresses the specified warnings in your project during compilation. You have to specify the numeric part of the compiler warning you want to suppress.

/optimize

Optimization by the compiler helps to make your compiled file smaller, faster and efficient. Hence by default its turned On. If you don't want the compiler to optimize your code then you can specify the /optimize- option. /o is the short form of /optimize.

/out

By default when the compiler compiles a file if its a Exe then the File name consists of the Class name which contains the Main method. If its a Dll file then the File name consists of the name of the first class found while compiling. If you want your own file name of the output file use this option.

/recurse

This option lets you compile source code files in all child directories of either the specified directory (dir) or of the project directory. You can use wildcards in a file name to compile all matching files in the project directory without using /recurse. This option is very useful if you have divided your project across directories.

/refrence

This option causes the compiler to make public type information in the specified files available to the project you are currently compiling. The file(s) you import must contain an assembly manifest (i.e. it should not be a module). /r is the short form of /reference. This is the most important option for beginner programmers. You have to reference all the files that you have imported in your code via the "using" keyword. Also if you are some custom libraries that you have created and used in your code then you have to reference them while compiling. Knowing which files to reference is very important. As I said above you can see all the namespaces you have imported via the "using" keyword then check in the reference documentation in which library the namespace is present. Then reference all these libraries generally the name of the library file is the same as the name of the namespace but with a .dll extension. For example while compiling a simple Winform application you need reference "System.dll", "System.WinForms.dll", "Microsoft.Win32.Interop.dll" and "System.Drawing.dll" .

/resource

The /resource option embeds a .NET resource to the output file in an assembly. /linkresource links a resource to an assembly but does not place the resource file in the output file while this option actually places the resource file in the output file.

/target

This option is used to tell the compiler the kind of output file you want. Except the /target:module option, this option places the assembly manifest in the output file. While compiling multiple files in a single command the assembly manifest is placed in the first file being compiled. The C# compiler can only produce .dlls or .exes. The following options are available with this switch:

/target:exe: This option will result in the output file being a Console Application executable file with the extension .exe . It must have at least one Main method.

/target:winexe: This option will result in the output file being a Windows Executable with the extension .exe, Windows executables contain GUI user interfaces provided by the .NET platform or Win32 API. Also use this option if you don't want the black console screen behind your applications. It must have at least one Main method.

/target:library: This option will create a Dll file with the extension .dll . A library Dll does contain a assembly manifest. A Main method is not required.

/target:module: This options creates a Dll file with the extension .dll. A module does not have a assembly manifest in it, so it cannot be loaded by the .NET runtime. A Main method is not required.

/unsafe

This options lets you compile code that contains unsafe unmanaged code like pointers etc. in it.

/warn

During compilation if you want to specify the level of warnings to be generated use this option.

/warnaserror

This options tells the compiler to treat all warnings generated in a program to be reported and treated as errors.

/win32icon

The /win32icon option inserts a .ico file in the output file, which gives the output file the desired appearance in the Windows Explorer. A .ico file can be created with the Resource Compiler. Use this option to add your own icons to your Projects.

/win32res

This option inserts a Win32 resource in the output file. A Win32 resource file can be created with the Resource Compiler. A Win32 resource can contain version or bitmap (icon) information that would help identify your application in the Windows Explorer. If you do not specify /win32res, the compiler will generate version information based on the assembly version.