Advanced Compiler Settings Dialog Box (Visual Basic)

Use the Advanced Compiler Settings dialog box of the Project Designer to specify the project's advanced build-configuration properties. This dialog box applies to Visual Basic projects only. For more information, see How to: Set Compiler Options (Visual Basic).

To access this dialog box

  1. Select a project node in Solution Explorer.

  2. On the Project menu, click Properties. When the Project Designer appears, click the Compile tab.

  3. On the Compile Page, Project Designer (Visual Basic), select the Configuration and Platform. In simplified build configurations, the Configuration and Platform lists are not displayed. For more information, see Debug and Release Project Configurations.

  4. Click Advanced Compile Options.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

Optimizations

The following options specify optimizations that can in some cases make a program file smaller, make a program run faster, or speed up the build process. See How to: Set Compiler Optimizations (Visual Basic).

  • Remove integer overflow checks
    By default, this check box is cleared to include integer overflow checks. Select this check box to remove integer overflow checks. If you select this check box, integer calculations might be faster. However, if you remove overflow checking and data type capacities overflow, incorrect results might be stored without an error being raised.

    If overflow conditions are checked and an integer operation overflows, an OverflowException exception is thrown. If overflow conditions are not checked, integer operation overflows do not throw an exception.

  • Enable optimizations
    By default, this check box is cleared to disable compiler optimizations. Select this check box to enable compiler optimizations. Compiler optimizations make your output file smaller, faster, and more efficient. However, because optimizations cause code rearrangement in the output file, compiler optimizations can make debugging difficult.

  • DLL base address
    This text box displays the default DLL base address in hexadecimal format. In Class Library and Control Library projects, you can use this text box to specify the base address to be used when the DLL is created.

  • Generate debug info
    Select None, Full, or pdb-only from the list. None specifies that no debugging information be generated. Full specifies that full debugging information be generated, and pdb-only specifies that only PDB debugging information be generated. By default, this option is set to Full.

Compilation Constants

Conditional compilation constants have an effect similar to that of using a #Const preprocessor directive in a source file, except that constants defined are public and apply to all files in the project. You can use conditional compilation constants together with the #If...Then...#Else directive to compile source files conditionally. See Conditional Compilation in Visual Basic.

  • Define DEBUG constant
    By default, this check box is selected, specifying that a DEBUG constant be set.

  • Define TRACE constant
    By default, this check box is selected, specifying that a TRACE constant be set.

  • Custom constants
    Enter any custom constants for your application in this text box. Entries should be delimited by commas, using this form: Name1="Value1",Name2="Value2",Name3="Value3".

Other Settings

  • Generate serialization assemblies
    This setting specifies whether the compiler will create XML serialization assemblies. Serialization assemblies can improve the startup performance of XmlSerializer if you have used that class to serialize types in your code. By default, this option is set to Auto, which specifies that serialization assemblies be generated only if you have used XmlSerializer to encode types in your code to XML. Off specifies that serialization assemblies never be generated, regardless of whether your code uses XmlSerializer. On specifies that serialization assemblies always be generated. Serialization assemblies are named TypeName.XmlSerializers.dll.

  • Target CPU
    This setting specifies whether the compiler should optimize compilation for a specific CPU type, for example, a 64-bit processor. Select AnyCPU, x86, x64, or Itanium from the list. By default, this option is set to AnyCPU, specifying that the compiler not optimize compilation for a specific CPU type.

    Note

    Visual Basic Express does not support optimization for a specific CPU type. This is supported only in the full Visual Studio product.

  • Target framework (all configurations)
    Specifies the version of the .NET Framework, or its profile, that the application targets. This option can have different values depending on which versions of the .NET Framework and which profiles are installed on your computer.

    An example of a .NET Framework profile is a client profile that represents a subset of the .NET Framework libraries and features that can be used to create client applications. For more information, see .NET Framework Client Profile.

    By default, the value is the same as the target framework that you selected in the New Project dialog box.

    When you change this value to .NET Framework 3.5 or later, a reference to System.Core and a project-level import for System.Linq are added automatically. If you want to use LINQ features, you will also need to turn Option Infer on. The reference and import are removed automatically if you change the target framework to 3.0 or 2.0.

    Note

    The prerequisite packages listed in the Prerequisites Dialog Box are set automatically the first time that you open the dialog box. If you subsequently change the project's target framework, you will have to select the prerequisites manually to match the new target framework.

    For more information, see How to: Target a Specific .NET Framework Version or Profile and Visual Studio Multi-Targeting Overview.

See Also

Reference

Compile Page, Project Designer (Visual Basic)