Skip to content

Repo sync for protected CLA branch #7461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions docs/debugger/debug-using-the-just-in-time-debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Debug using the Just-In-Time Debugger | Microsoft Docs
description: Debug using the Just-In-Time Debugger in Visual Studio. Just-In-Time debugging can launch Visual Studio automatically when an app errors or crashes.
ms.custom: SEO-VS-2020
ms.date: 08/24/2021
ms.date: 12/20/2021
ms.topic: how-to
helpviewer_keywords:
- debugging [Visual Studio], Just-In-Time
Expand Down Expand Up @@ -50,23 +50,23 @@ Just-In-Time debugging may still be enabled even if Visual Studio is no longer i

1. From the Windows **Start** menu, run the **Registry Editor** (*regedit.exe*).

2. In the **Registry Editor** window, locate and delete the following registry entries:
2. In the **Registry Editor** window for 64-bit computers, locate and delete the following registry entries:

- **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\\.NETFramework\DbgManagedDebugger**
- **HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\DbgManagedDebugger**

- **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger**
- **HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger**

![JIT registry key](../debugger/media/dbg-jit-registry.png "JIT registry key")
:::image type="content" source="../debugger/media/dbg-jit-registry.png" alt-text="JIT registry key" border="true":::

3. If your computer is running a 64-bit operating system, also delete the following registry entries:
3. If the following registry entries are present, or your computer is running a 32-bit operating system, delete the following entries:

- **HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\DbgManagedDebugger**
- **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\\.NETFramework\DbgManagedDebugger**

- **HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger**
- **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger**

Make sure not to delete or change any other registry keys.

5. Close the **Registry Editor** window.
4. Close the **Registry Editor** window.

## Enable Just-In-Time debugging of a Windows Form

Expand All @@ -93,6 +93,7 @@ To enable Just-In-Time debugging instead of standard Windows Form error handling
For more information, see <xref:System.Diagnostics.DebuggableAttribute>.

## <a name="BKMK_Using_JIT"></a>Use Just-In-Time debugging

This example walks you through Just-In-Time debugging when an app throws an error.

- You must have Visual Studio installed to follow these steps. If you don't have Visual Studio, you can download the free [Visual Studio Community Edition](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15).
Expand Down Expand Up @@ -125,7 +126,7 @@ For this example, you'll make a C# console app in Visual Studio that throws a [N

You should see the following command window:

![Screenshot of the console for ThrowsNullException.exe, which throws an unhandled null reference exception (System.NullReferenceException).](../debugger/media/throwsnullexceptionconsole.png)
![Screenshot of the console for ThrowsNullException.exe, which throws an unhandled null reference exception (System.NullReferenceException).](../debugger/media/throws-null-exception-console.png)

1. The **Choose Just-In-Time Debugger** dialog opens.

Expand All @@ -137,7 +138,7 @@ For this example, you'll make a C# console app in Visual Studio that throws a [N

The ThrowsNullException project opens in a new instance of Visual Studio, with execution stopped at the line that threw the exception:

![Screenshot of the ThrowsNullException project in Visual Studio, with highlighting of the line of source code that threw the exception.](../debugger/media/nullreferencesecondinstance.png)
![Screenshot of the ThrowsNullException project in Visual Studio, with highlighting of the line of source code that threw the exception.](../debugger/media/null-reference-second-instance.png)

You can start debugging at this point. If you were debugging a real app, you would need to find out why the code is throwing the exception.

Expand All @@ -152,19 +153,19 @@ If Just-In-Time debugging doesn't start when an app crashes, even though it is e

To fix this issue, use Registry Editor to add a **DWORD Value** of **Disabled**, with **Value data** of **1**, to the following registry keys:

- **HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting**

- (For 64-bit machines): **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\Windows Error Reporting**
- **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\Windows Error Reporting**
- (For 32-bit machines) **HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting**

For more information, see [.WER settings](/windows/desktop/wer/wer-settings).

- A known Windows issue may be causing the Just-In-Time debugger to fail.

The fix is to add a **DWORD Value** of **Auto**, with **Value data** of **1**, to the following registry keys:

- **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug**
- **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug**

- (For 64-bit machines): **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug**
- (For 32-bit machines) **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug**

You might see the following error messages during Just-In-Time debugging:

Expand Down
64 changes: 42 additions & 22 deletions docs/debugger/how-to-set-debug-and-release-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Set debug and release configurations | Microsoft Docs
description: Set debug and release configurations in Visual Studio. You build the debug version for debugging and the release version for the final release distribution.
ms.custom: SEO-VS-2020
ms.date: 10/05/2018
ms.date: 12/21/2021
ms.topic: how-to
f1_keywords:
- vs.debug.builds
Expand Down Expand Up @@ -51,13 +51,13 @@ You can change the build configuration from the **Build** menu, from the toolbar

To change the build configuration, either:

* From the **Build** menu, select **Configuration Manager**, then select **Debug** or **Release**.
* On the toolbar, choose either **Debug** or **Release** from the **Solution Configurations** list.

or
![toolbars build configuration](../debugger/media/toolbar-build-configuration.png "ToolbarBuildConfiguration")

* On the toolbar, choose either **Debug** or **Release** from the **Solution Configurations** list.
or

![toolbars build configuration](../debugger/media/toolbarbuildconfiguration.png "ToolbarBuildConfiguration")
* From the **Build** menu, select **Configuration Manager**, then select **Debug** or **Release**.

## <a name="BKMK_symbols_release"></a>Generate symbol (.pdb) files for a build (C#, C++, Visual Basic, F#)

Expand All @@ -68,49 +68,69 @@ You can choose to generate symbol (.pdb) files and what debug information to inc

Each project type may have a different way of setting these options.

### Generate symbol files for a C#, ASP.NET, or Visual Basic project
::: moniker range=">=vs-2022"
### Generate symbol files for a C# or ASP.NET Core project (.NET only)

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).
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 .NET projects in Visual Basic, symbol files are configured the same as in .NET Framework.)

1. In Solution Explorer, select the project.
1. In Solution Explorer, right-click the project and choose **Properties**.

2. Select the **Properties** icon (or press **Alt+Enter**).
2. In the side pane, choose **Build** > **General**.

3. In the side pane, choose **Build** (or **Compile** in Visual Basic).
3. In the **Optimize code** section, choose **Debug** or **Release**.

4. In the **Configuration** list, choose **Debug** or **Release**.
4. In the **Debug symbols** list, choose **PDB file, current platform**, **PBD file, portable**, or **Embedded**.

5. Select the **Advanced** button (or the **Advanced Compile Options** button in Visual Basic).
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).

![Generate PDBs for builds in .NET](../debugger/media/vs-2022/dbg-project-properties-pdb-dotnet.png "GeneratePDBsForDotNet")

5. Build your project.

The compiler creates the symbol file(s) in the same folder as the executable or the main output file.
::: moniker-end

6. In the **Debugging information** list (or the **Generate debug info** list in Visual Basic), choose **Full**, **Pdb-only**, or **Portable**.
### Generate symbol files for a C#, ASP.NET, or Visual Basic project (.NET Framework)

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).

1. In Solution Explorer, right-click the project and choose **Properties**.

2. In the side pane, choose **Build** (or **Compile** in Visual Basic).

3. In the **Configuration** list at the top, choose **Debug** or **Release**.

4. Select the **Advanced** button (or the **Advanced Compile Options** button in Visual Basic).

5. In the **Debugging information** list (or the **Generate debug info** list in Visual Basic), choose **Full**, **Pdb-only**, or **Portable**.

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).

![Generate PDBs for builds in C#](../debugger/media/dbg_project_properties_pdb_csharp.png "GeneratePDBsForCSharp")
![Generate PDBs for builds in C#](../debugger/media/dbg-project-properties-pdb-csharp.png "GeneratePDBsForCSharp")

7. Build your project.
6. Build your project.

The compiler creates the symbol file(s) in the same folder as the executable or the main output file.

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

1. In Solution Explorer, select the project.
1. In Solution Explorer, right-click the project and choose **Properties**.

2. Select the **Properties** icon (or press **Alt+Enter**).
2. In the **Configuration** list, choose **Debug** or **Release**.

3. In the **Configuration** list, choose **Debug** or **Release**.
3. In the side pane, choose **Linker > Debugging**, then select options for **Generate Debug Info**.

4. In the side pane, choose **Linker > Debugging**, then select options for **Generate Debug Info**.
In most C++ projects, the default value is **Generate Debug Information (/DEBUG)**.

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).

5. Configure options for **Generate Program Database Files**.
4. Configure options for **Generate Program Database Files**.

In most C++ projects, the default value is `$(OutDir)$(TargetName).pdb`, which generates .pdb files in the output folder.

![Generate PDBs for builds in C++](../debugger/media/dbg_project_properties_pdb_cplusplus.png "GeneratePDBsforCPlusPlus")
![Generate PDBs for builds in C++](../debugger/media/dbg-project-properties-pdb-cplusplus.png "GeneratePDBsforCPlusPlus")

6. Build your project.
5. Build your project.

The compiler creates the symbol file(s) in the same folder as the executable or the main output file.

Expand Down
2 changes: 1 addition & 1 deletion docs/debugger/how-to-use-the-modules-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The **Symbol Status** column in the **Modules** window shows which modules have

1. If the symbols don't load, select **Symbol Settings** to open the **Options** dialog, and specify or change symbol loading locations.

You can download symbols from the public Microsoft Symbol Servers or other servers, or load symbols from a folder on your computer. For details, see [Specify symbol locations and loading behavior](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#BKMK_Specify_symbol_locations_and_loading_behavior).
You can download symbols from the public Microsoft Symbol Servers or other servers, or load symbols from a folder on your computer. For details, see [Configure location of symbol files and loading behavior](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#configure-location-of-symbol-files-and-loading-options).

**To change symbol loading behavior settings:**

Expand Down
Binary file modified docs/debugger/media/dbg-jit-enable-or-disable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/debugger/media/nullreferencesecondinstance.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/debugger/media/throwsnullexceptionconsole.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/debugger/media/toolbarbuildconfiguration.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/debugger/navigating-through-code-with-the-debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ To look at framework code, third-party library code, or system calls while debug

If you've loaded debugging symbols for Microsoft system code and disabled Just My Code, you can step into a system call just as you can any other call.

To learn about loading Microsoft symbols, see [Configure symbol locations and loading options](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#configure-symbol-locations-and-loading-options).
To learn about loading Microsoft symbols, see [Configure location of symbol files and loading options](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#configure-location-of-symbol-files-and-loading-options).

**To load symbols for a specific system component**

Expand Down
Loading