RAD Studio (Common)
ContentsIndex
PreviousUpNext
Compiler

ProjectOptionsCompiler 

Use this dialog box to set the C# compiler options for the current project.

Item 
Description 
Debug/Release 
Indicates the current set of project options. By default, the distributed Debug and Release option sets have settings appropriate for debugging and deploying an application, respectively. The option sets provide an easy way to change project options based on your development activity. To create a user-defined option set, use the Save as button.  
Save as 
Displays a dialog box for naming and saving a user-defined set of project options.  
Delete 
Deletes the current option set. Only user-defined option sets can be deleted. The distributed Debug and Release option sets can not be deleted.  
Optimization 
Enables optimizations performed by the compiler to make your output file smaller, faster, and more efficient. This option also tells the common language runtime to optimize code at runtime.
Corresponds to /optimize.  
Allow unsafe code 
Allows code that uses the unsafe keyword to compile.
Corresponds to /unsafe.  
Treat warnings as errors 
Reports all warnings as errors. Any messages that would ordinarily be reported as warnings are instead reported as errors, and the build process is halted (no output files are built).
Corresponds to /warnaserror.  
Warning level 
Specifies the warning level for the compiler to display.
0 Suppresses all warning messages.
1 Displays severe warning messages.
2 Displays level 1 warnings plus certain less severe warnings, such as warnings about hiding class members.
3 Displays level 2 warnings plus certain less severe warnings, such as warnings about expressions that always evaluate to true or false.
4 Displays all level 3 warnings plus informational warnings.
Corresponds to /warn. The default is 4.  
Debug information 
Causes the compiler to generate debugging information and place it in a program database file (.pdb) the next time you compile the application.
  • None — No debugging information will be available.
  • Full — Enables attaching a debugger to the running program.
  • PDB only — Allows source code debugging when the program is started in the debugger but will only display assembler when the running program is attached to the debugger.

Corresponds to /debug. The default is Full for the Debug configuration, or PDB Only for the Release configuration.  
Target platform 
Specifies which version of the common language runtime (CLR) can run the assembly.
  • Any CPU — Compiles your assembly to run on any platform.
  • x86 — Compiles your assembly to be run by the 32-bit, x86-compatible common language runtime.
  • x64 — Compiles your assembly to be run by the 64-bit common language runtime on a computer that supports the AMD64 or EM64T instruction set.
Corresponds to /platform. The default is x86 for the Debug configuration, or Any CPU for the Release configuration..  
Base address 
Specifies the preferred base address at which to load the DLL. The default base address for a DLL is set by the .NET Framework common language runtime. This address can be specified as a decimal or hexadecimal number.
Corresponds to /baseaddress.  
File alignment 
Specifies the alignment used for output file sections. Choose a value (in bytes) that specifies the size of sections in the output file. Choices are 512, 1024, 2048, 4096, and 8192 bytes.
Corresponds to /filealign. There is no fixed default. If /filealign is not specified, the CLR picks a default at compile time.  
Generate XML documentation 
Processes documentation comments in the code and creates an XML file named ProjectDoc.xml in the same directory as the project file (.csproj for MSBuild format).
Lines beginning with /// and preceding a user-defined type such as a class, delegate, or interface; a member such as a field, event, property, or method; or a namespace declaration can be processed as comments and placed in the file.
Corresponds to /doc.  
Do not reference mscorlib.dll 
Prevents the import of mscorlib.dll, which defines the entire System namespace. Use this option if you want to define or create your own System namespace and objects.
Corresponds to /nostdlib.  
Generate overflow checks 
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.
Corresponds to /checked.  
Codepage 
Specifies the codepage to use during compilation if the required page is not the current default codepage for the system.
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 this option to specify which code page should be used. This option 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 need not use this option.
Corresponds to /codepage.  
Language version 
Specifies whether the compiler will only accept syntax that is included in the ISO/IEC 23270:2003 C# language specification.
Corresponds to /langversion. The default is to accept all valid language syntax  

Tip: To display the compiler options in the Message
window when you compile a project, choose ToolsOptionsEnvironment Options and select the Show command line option. The next time you compile a project, the command used to compile the project will be displayed in the Messages window.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!