Skip to content

Commit a7e9862

Browse files
authored
Merge pull request #3066 from DennisLee-DennisLee/v-dele-1344158
1344158: Refreshed the **Set debug and release configurations in Visual Studio** article.
2 parents c387d6b + 843c0cd commit a7e9862

File tree

4 files changed

+62
-54
lines changed

4 files changed

+62
-54
lines changed
Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
title: "Set debug and release configurations | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "04/10/2017"
4+
ms.date: "10/05/2018"
55
ms.technology: "vs-ide-debug"
66
ms.topic: "reference"
7-
f1_keywords:
7+
f1_keywords:
88
- "vs.debug.builds"
9-
dev_langs:
9+
dev_langs:
1010
- "CSharp"
1111
- "VB"
1212
- "FSharp"
1313
- "C++"
1414
- "JScript"
15-
helpviewer_keywords:
15+
helpviewer_keywords:
1616
- "configurations, release"
1717
- "build configurations, release"
1818
- "projects [Visual Studio], release configurations"
@@ -31,85 +31,93 @@ ms.assetid: 57b6bbb7-f2af-48f7-8773-127d75034ed2
3131
author: "mikejo5000"
3232
ms.author: "mikejo"
3333
manager: douge
34-
ms.workload:
34+
ms.workload:
3535
- "multiple"
3636
---
3737
# Set debug and release configurations in Visual Studio
38-
Visual Studio projects have separate release and debug configurations for your program. As the names imply, you build the debug version for debugging and the release version for the final release distribution.
39-
40-
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.
41-
42-
The release configuration of your program contains no symbolic debug information and is fully optimized. Debug information can be generated in .pdb files, [depending on the compiler options](#BKMK_symbols_release) that are used. Creating .pdb files can be very useful if you later have to debug your release version.
43-
44-
For more information about build configurations, see [Understanding Build Configurations](../ide/understanding-build-configurations.md).
45-
46-
You can change the build configuration from the **Build** menu, from the toolbar, or in the project's property pages. Project property pages are language-specific. The procedure below shows how to change the build configuration from the menu and the toolbar. For more information about how to change the build configuration in projects in different languages, see the See Also section below.
47-
48-
## Change the build configuration
49-
50-
1. From the **Build** menu, select **Configuration Manager**, then select **Debug** or **Release**.
51-
52-
2. On the toolbar, choose either **Debug** or **Release** from the **Solution Configurations** list box.
53-
54-
![toolbar build configuration](../debugger/media/toolbarbuildconfiguration.png "ToolbarBuildConfiguration")
55-
56-
This toolbar is not available in Express editions. You can use the **Build Solution F6** and **Start Debugging F5** menu items to choose the configuration.
38+
39+
Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution.
40+
41+
In debug configuration, your program compiles with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex.
42+
43+
The release configuration of your program has no symbolic debug information and is fully optimized. Debug information can be generated in .pdb files, [depending on the compiler options](#BKMK_symbols_release) that are used. Creating .pdb files can be useful if you later have to debug your release version.
44+
45+
For more information about build configurations, see [Understand build configurations](../ide/understanding-build-configurations.md).
46+
47+
You can change the build configuration from the **Build** menu, from the toolbar, or in the project's property pages. Project property pages are language-specific. The procedure below shows how to change the build configuration from the menu and the toolbar. For more information about how to change the build configuration in projects in different languages, see the [See also](#see-also) section below.
48+
49+
## Change the build configuration
50+
51+
To change the build configuration, either:
52+
53+
* From the **Build** menu, select **Configuration Manager**, then select **Debug** or **Release**.
54+
55+
or
56+
57+
* On the toolbar, choose either **Debug** or **Release** from the **Solution Configurations** list.
58+
59+
![toolbars build configuration](../debugger/media/toolbarbuildconfiguration.png "ToolbarBuildConfiguration")
5760

5861
## <a name="BKMK_symbols_release"></a>Generate symbol (.pdb) files for a build
5962

60-
For most project types, the .pdb files are generated by default for both debug and release builds, but the default settings are different depending on your specific project type and the version of Visual Studio. You can configure whether the compiler generates .pdb files and what kind of debug information to include.
63+
You can choose to generate symbol (.pdb) files and what debug information to include. For most project types, the compiler generates symbol files by default for debug and release builds, while other default settings differ by project type and Visual Studio version.
6164

62-
> [!IMPORTANT]
63-
> The debugger will load only a .pdb file for an executable file that exactly matches the .pdb file that was created when the executable was built (that is, the .pdb must be the original or a copy of the original .pdb file). For more information see [Why does Visual Studio require debugger symbol files to exactly match the binary files that they were built with?](https://blogs.msdn.microsoft.com/jimgries/2007/07/06/why-does-visual-studio-require-debugger-symbol-files-to-exactly-match-the-binary-files-that-they-were-built-with/)
65+
> [!IMPORTANT]
66+
> The debugger will load only a .pdb file for an executable file that exactly matches the .pdb file that was created when the executable was built (that is, the .pdb must be the original or a copy of the original .pdb file). For more information, see [Why does Visual Studio require debugger symbol files to exactly match the binary files that they were built with?](https://blogs.msdn.microsoft.com/jimgries/2007/07/06/why-does-visual-studio-require-debugger-symbol-files-to-exactly-match-the-binary-files-that-they-were-built-with/)
6467
6568
Each project type may have a different way of setting these options.
6669

6770
### Generate symbol files for a C#, ASP.NET, or Visual Basic project
6871

69-
For detailed information on project settings for debug configurations in C#, see [Project settings for a C# Debug configuration](../debugger/project-settings-for-csharp-debug-configurations.md). For Visual Basic, see [this topic](../debugger/project-settings-for-a-visual-basic-debug-configuration.md).
72+
For detailed information on project settings for debug configurations in C# or Visual Basic, see [Project settings for a C# debug configuration](../debugger/project-settings-for-csharp-debug-configurations.md) or [Project settings for a Visual Basic debug configuration](../debugger/project-settings-for-a-visual-basic-debug-configuration.md).
7073

71-
1. Right-click the project in Solution Explorer and choose **Properties**.
74+
1. In Solution Explorer, select the project.
7275

73-
2. Choose a **Release** or **Debug** build from the **Configuration** list.
76+
2. Select the **Properties** icon (or press **Alt+Enter**).
7477

75-
2. Choose **Build** settings and then click the **Advanced** button.
78+
3. In the side pane, choose **Build** (or **Compile** in Visual Basic).
7679

77-
In Visual Basic, you choose the **Compile** settings and the **Advanced Compile Options** button instead.
80+
4. In the **Configuration** list, choose **Debug** or **Release**.
7881

79-
3. Choose **full**, **portable**, or **pdb_only** in the **Debugging information** list box (**Generate debug info** in Visual Basic).
82+
5. Select the **Advanced** button (or the **Advanced Compile Options** button in Visual Basic).
8083

81-
The portable format is the most recent cross-platform format for .NET Core. For more information on options, see [Advanced Build Settings dialog box (C#)](../ide/reference/advanced-build-settings-dialog-box-csharp.md).
84+
6. In the **Debugging information** list (or the **Generate debug info** list in Visual Basic), choose **Full**, **Pdb-only**, or **Portable**.
8285

83-
![Generate PDBs for builds in C#](../debugger/media/dbg_project_properties_pdb_csharp.png "GeneratePDBsForCSharp")
86+
The portable format is the most recent cross-platform format for .NET Core. For more information on options, see [Advanced Build Settings dialog box (C#)](../ide/reference/advanced-build-settings-dialog-box-csharp.md).
8487

85-
4. Build your project.
88+
![Generate PDBs for builds in C#](../debugger/media/dbg_project_properties_pdb_csharp.png "GeneratePDBsForCSharp")
8689

87-
The symbol file(s) get created in the same folder as the executable or the main output file.
90+
7. Build your project.
91+
92+
The compiler creates the symbol file(s) in the same folder as the executable or the main output file.
8893

8994
### Generate symbol files for a C++ project
9095

91-
1. Right-click the project in Solution Explorer and choose **Properties**.
96+
1. In Solution Explorer, select the project.
97+
98+
2. Select the **Properties** icon (or press **Alt+Enter**).
99+
100+
3. In the **Configuration** list, choose **Debug** or **Release**.
92101

93-
2. Choose a **Release** or **Debug** build from the **Configuration** list.
102+
4. In the side pane, choose **Linker > Debugging**, then select options for **Generate Debug Info**.
94103

95-
2. Under **Linker > Debugging**, select desired options for **Generate Debug Info**.
104+
For detailed information on project settings for debug configurations in C++, see [Project settings for a C++ debug configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md).
96105

97-
For detailed information on project settings for debug configurations in C++, see [Project settings for a C++ Debug configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md).
106+
5. Configure options for **Generate Program Database Files**.
98107

99-
4. Configure options for Generate Program Database Files
108+
In most C++ projects, the default value is `$(OutDir)$(TargetName).pdb`, which generates .pdb files in the output folder.
100109

101-
In most C++ projects, the default value is `$(OutDir)$(TargetName).pdb`, which generates .pdb files in the output folder.
110+
![Generate PDBs for builds in C++](../debugger/media/dbg_project_properties_pdb_cplusplus.png "GeneratePDBsforCPlusPlus")
102111

103-
![Generate PDBs for builds in C++](../debugger/media/dbg_project_properties_pdb_cplusplus.png "GeneratePDBsforCPlusPlus")
112+
6. Build your project.
104113

105-
5. Build your project.
114+
The compiler creates the symbol file(s) in the same folder as the executable or the main output file.
106115

107-
The symbol file(s) get created in the same folder as the executable or the main output file.
108-
109-
## See Also
110-
[Specify symbol (.pdb) files and source files in the Visua Studio debugger](../debugger/debugger-settings-and-preparation.md)
111-
[Debugger Settings and Preparation](../debugger/debugger-settings-and-preparation.md)
112-
[Project Settings for a C++ Debug Configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md)
113-
[Project Settings for C# Debug Configurations](../debugger/project-settings-for-csharp-debug-configurations.md)
114-
[Project Settings for a Visual Basic Debug Configuration](../debugger/project-settings-for-a-visual-basic-debug-configuration.md)
115-
[How to: Create and Edit Configurations](../ide/how-to-create-and-edit-configurations.md)
116+
## <a name="see-also"></a>See also
117+
118+
[Specify symbol (.pdb) files and source files in the Visual Studio debugger](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md)<br/>
119+
[Debugger settings and preparation](../debugger/debugger-settings-and-preparation.md)<br/>
120+
[Project settings for a C++ debug configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md)<br/>
121+
[Project settings for a C# debug configuration](../debugger/project-settings-for-csharp-debug-configurations.md)<br/>
122+
[Project settings for a Visual Basic debug configuration](../debugger/project-settings-for-a-visual-basic-debug-configuration.md)<br/>
123+
[How to: Create and edit configurations](../ide/how-to-create-and-edit-configurations.md)
Loading
Loading
Loading

0 commit comments

Comments
 (0)