Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
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.

Compile Page, Project Designer (Visual Basic)

Use the Compile page of the Project Designer to specify compilation instructions. You can also specify advanced compiler options and pre-build or post-build events here.

To access the Compile page, select a project node in Solution Explorer, then on the Project menu, click Properties. When the Project Designer appears, click the Compile tab.

NoteNote

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 active settings that you use determine these elements. This topic was written assuming that General Development settings have been selected. To view or change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings. For more information, see Visual Studio Settings.

Configuration and Platform

The following options allow you to select the configuration and platform to display or modify.

NoteNote

With simplified build configurations, the project system determines whether to build a debug or release version. Therefore, these options are not displayed. To enable advanced build configurations, on the Tools menu, click Options. In the Options dialog box, expand Projects and Solutions, click General, and then select the Show advanced build configurations check box. This gives you manual control over all configuration values and whether a debug or release version is built. For more information, see General, Projects and Solutions, Options Dialog Box.

Configuration

Specifies which configuration settings to display or modify. The settings can be Active (Debug) (this is the default), Debug, Release, or All Configurations.

Platform

Specifies which platform settings to display or modify. The default setting is Active (Any CPU). You can change the active platform using the Configuration Manager. For more information, see How to: Create and Edit Configurations.

Compiler Configuration Options

The following options allow you to set the compiler configuration options.

Build output path

Enter the path of the build output in this box, or click the Browse button to select a path. Note that the path is relative; if you enter an absolute path, it will be saved as relative.

With simplified build configurations, the project system determines whether to build a debug or release version. The Build command from the Debug menu (F5) will put the build in the debug location regardless of the Output path you specify. However, the Build command from the Build menu puts it in the location you specify. To enable advanced build configurations, on the Tools menu, click Options. In the Options dialog box, expand Projects and Solutions, click General, and then clear the Show advanced build configurations check box. This gives you manual control over all configuration values and whether a debug or release version is built. For more information, see General, Projects and Solutions, Options Dialog Box.

Advanced Compile Options

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 Advanced Compiler Settings Dialog Box (Visual Basic).

Option explicit

Select On or Off from the drop-down list. By default, this setting is On, requiring explicit declaration of variables; this causes the compiler to report errors if variables are not declared prior to use. Select Off to allow implicit declaration of variables.

This setting corresponds to the /optionexplicit compiler option.

Option strict

Select On or Off from the drop-down list. By default, this setting is Off, allowing permissive type semantics. Select On to restrict implicit type conversion; that is, explicit narrowing conversions will be required and late binding will not be allowed.

This setting corresponds to the /optionstrict compiler option.

Option compare

Select Binary or Text from the drop-down list. By default, this setting is Binary, instructing the compiler to use binary, case-sensitive string comparisons. Select Text to use locale-specific, case-insensitive text string comparisons.

This setting corresponds to the /optioncompare compiler option.

Condition/Notification table

This table lists build conditions and the corresponding notification level of None, Warning, or Error for each.

By default, all compiler warnings are added to the Task List during compilation. Use Disable all warnings to instruct the compiler not to issue warnings, or Treat all warnings as errors if you want the compiler to treat warnings as errors that must be fixed.

Disable all warnings

By default, this check box is cleared, allowing the compiler to issue notifications as specified in the Condition/Notification table above. Select this check box to instruct the compiler not to issue warnings or errors.

This setting corresponds to the /nowarn compiler option.

Treat all warnings as errors

By default, this check box is cleared, so that all warning notifications remain set to Warning. Select this check box to change all warning notifications to Error.

This option is available only if Disable all warnings is cleared.

Generate XML documentation file

By default, this check box is selected, instructing the compiler to generate documentation information and place it in an XML file. Clear this check box to instruct that no documentation be created.

This setting corresponds to the /doc compiler option.

Register for COM interop

This option specifies whether your managed application will expose a COM object (a COM-callable wrapper) that allows a COM object to interact with your managed application.

By default, this check box is cleared, specifying that the application will not allow COM interop. Select this check box to allow COM interop.

This option is not available for Windows Application or Console Application projects.

Build Events

Use the Build Events dialog box of the Project Designer to specify pre-build and post-build configuration instructions for the project. This dialog box applies to Visual Basic projects only. For more information, see Build Events Dialog Box (Visual Basic).

See Also

Community Additions

ADD
Show:
© 2015 Microsoft