Partilhar via


How to: Set Debug and Release Configurations 

A Visual Studio 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, since the relationship between source code and generated instructions is more complex.

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

You can switch between Release and Debug versions using the Standard toolbar or the Configuration Manager. For more information see How to: Create and Edit Configurations.

NoteNote

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. If you want to change the Development Settings, see How to: Restore Hidden Debugger Commands.

Procedures

To switch to the Debug or Release configuration

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

You can change the settings for a configuration using the <Project> Property Pages. Depending on the project type, this window will either be a dialog box containing a tree control on the left for navigating categories—Visual C++ and web sites—or a tabbed window in the text editor pane of Visual Studio.

To change the settings for the Debug or Release configuration

  1. In Solution Explorer, select the project.

  2. On the View menu, click Property Pages. Or you can right-click on the project name in Solution Explorer, and select Property Pages.

  3. In the <Project> property page, select either the Debug tab or, if the project type is a Web site, Start Options.

  4. In the Configuration list box, click Debug or Release.

  5. Edit the value of the configuration settings you want to change. Not all debugger-related properties are contained in the Debug page, there are more on the Build page. The exact tabs displayed will vary by project type.

See Also

Reference

Project Settings for a C++ Debug Configuration

Concepts

Project Settings for C# and J# Debug Configurations
Project Settings for a Visual Basic Debug Configuration

Other Resources

Debug Settings and Preparation