How to: Set Debug and Release Configurations

This topic applies to:

Edition

Visual

Basic

C#

F#

C++

Web Developer

Express

Topic applies Topic applies Topic applies Topic applies Topic applies

Pro, Premium, and Ultimate

Topic applies Topic applies

Topic applies

Topic applies

Topic applies

A Visual Studio 2010 project has separate configurations for Release and Debug versions of your program. As the names imply, you build the Debug version for debugging and the Release version for the final release distribution.

If you create your program in Visual Studio, Visual Studio automatically creates these configurations and sets appropriate default options and other settings. With the default settings:

  • The Debug configuration of your program is compiled with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex.

  • The Release configuration of your program contains no symbolic debug information and is fully optimized. Debug information can be generated in Program Database Files (C++), depending on the compiler options that are used. Creating PDB files can be very useful if you later have to debug your release version.

You can switch between Release and Debug versions by using the Standard toolbar or the Configuration Manager.

Note

When you set up Visual Studio, you are asked to choose a set of Development Settings for your primary programming language. If you choose the Visual Basic Development Settings, the tool for choosing the Debug or Release configuration does not appear in the toolbar. Instead, Visual Studio automatically chooses the Debug configuration when you choose Start from the Debug menu and the Release configurations when you use the Build menu. To change the Development Settings, see How to: Restore Hidden Debugger Commands. After you change the Development Settings, make sure that Show advanced build configurations is selected in the Options dialog box, Project and Solutions category, General page.

To switch to the Debug or Release configuration quickly

  • On the Standard toolbar, choose either Debug or Release from the Solution Configurations list box.

  • This toolbar is not available in the Visual Basic Express or Visual C# Express. You can use the Build Solution F6 and Start Debugging F5 menu items to choose the configuration.

To switch to the Debug or Release configuration

  1. In Solution Explorer, select the project.

  2. On the View menu, click Property Pages.

  3. Click the Build or Debug tab, in a Visual C# or a Visual F# project, the Compile or Debug tab, in a Visual Basic project, or Configuration Properties, in a Visual C++ project.

  4. In the Configuration drop-down list, click Debug or Release.

See Also

Tasks

How to: Create and Edit Configurations

Reference

Project Settings for a C++ Debug Configuration

Debug and Release Project Configurations

Concepts

Project Settings for C# Debug Configurations

Project Settings for a Visual Basic Debug Configuration

Other Resources

Debug Settings and Preparation