Debug Setup

The Visual Studio debugger is fully configurable. Debugging sessions can be tailored to specific requirements of an application. For convenience, debug settings are saved in a configuration. There are two initial predefined configurations, Debug and Release, which represent the most commonly used settings. The Debug configuration contains the default project settings for creating debug builds, whereas the Release configuration has common options for release builds.

Prior to changing project settings, it is good policy to confirm the active configuration. This prevents inadvertent changes to the wrong configuration.

Debug and Release Configurations

As mentioned, the default configurations are Debug and Release. There are literally dozens of project options set in the predefined Debug and Release configurations. You can view these options on the Build tab of the <project> Properties window.

The important settings of the Debug configuration are as follows:

  • The DEBUG and TRACE constants—which control the behavior of the TraceSource, Debug, and Trace classes—are defined.

  • The Debug Info option is set to full. This option requests the creation of a symbol (.pdb) file whenever a project is built.

  • The output path is bindebug.

  • The Optimize Code option is set to false, which disables code optimization.

The key debug settings of the Release configuration are as follows:

  • The DEBUG constant is not defined; however, the TRACE constant remains defined.

  • The Debug Info option is set to pdb-only.

  • The output path is bin elease.

  • The Optimize Code option is set to true, which enables code optimization.

Configuration Manager

Use the Configuration Manager to view, edit, and create new configurations. To open the Configuration Manager, choose the Configuration Manager command from the Build menu. Figure 15-3 shows the Configuration Manager. The Configuration Manager lists the current configuration of each project in the solution. Initially, there should be the Debug and Release configurations.

The Configuration Manager

Figure 15-3. The Configuration Manager

Display the available configurations in the Active solution configuration drop-down list. You can set the current configuration from the drop-down list. You also can create a new configuration. Finally, you can rename or remove an existing configuration. The Active Solution Platform drop-down list assigns a platform to the current configuration.

Each row of the Configuration Manager window is a project. The project list has several columns of information:

  • Project. This column shows the name of each project.

  • Configuration. This column sets the current configuration of the project.

  • Platform. This column sets the target platform of the project.

  • Build. This column is an option box, which includes or excludes a project in the build when building the solution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.9.148