You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/debugger/how-to-debug-in-mixed-mode.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Debug in Mixed Mode (managed and native code)
3
3
description: Enable mixed-mode debugging (managed and native code together) in Visual Studio with the property pages of the calling app's project.
4
-
ms.date: 09/18/2024
4
+
ms.date: 3/17/2025
5
5
ms.topic: how-to
6
6
dev_langs:
7
7
- CSharp
@@ -16,6 +16,7 @@ author: mikejo5000
16
16
ms.author: mikejo
17
17
manager: mijacobs
18
18
ms.subservice: debug-diagnostics
19
+
zone_pivot_groups: programming-languages-set-two
19
20
20
21
#customer intent: As a developer, I want to enable mixed-mode debugging in Visual Studio, so I can use managed and native code together for C#, C++, or Visual Basic.
21
22
---
@@ -35,6 +36,7 @@ If you don't have access to a calling app's project, you can debug the DLL from
35
36
> [!NOTE]
36
37
> The dialogs and commands described in this article might differ from your experience, depending on your Visual Studio settings or edition. To change your settings, select **Tools** > **Import and Export Settings**. For more information, see [Reset all settings](../ide/personalizing-the-visual-studio-ide.md#reset-all-settings).
37
38
39
+
::: zone pivot="programming-language-cpp"
38
40
## Enable mixed-mode for native calling app (C++)
39
41
40
42
To enable mixed-mode debugging for a native calling app in C++, follow these steps:
@@ -48,7 +50,9 @@ To enable mixed-mode debugging for a native calling app in C++, follow these ste
48
50
:::image type="content" source="../debugger/media/dbg-mixed-mode-from-native.png" border="false" alt-text="Screenshot that shows how to enable mixed mode debugging for a C++ project in Visual Studio.":::
49
51
50
52
1. To apply the property change, select **OK**.
53
+
::: zone-end
51
54
55
+
::: zone pivot="programming-language-dotnet"
52
56
## Enable mixed-mode for managed calling app (C# or Visual Basic)
53
57
54
58
To enable mixed-mode debugging for a managed calling app in C# or Visual Basic, follow these steps:
@@ -73,6 +77,34 @@ To enable mixed-mode debugging for a managed calling app in C# or Visual Basic,
73
77
74
78
1. To apply the property change, close the **Launch Profiles** dialog and the **Properties** pane.
75
79
80
+
::: moniker-end
81
+
::: moniker range="<=vs-2019"
82
+
83
+
1. On the left menu, select **Debug**.
84
+
85
+
1. In the **Debugger engines** section, select the **Enable native code debugging** property:
86
+
87
+
:::image type="content" source="../debugger/media/mixed-mode-enable-native-code-debugging.png" border="false" alt-text="Screenshot that shows how to enable mixed mode debugging for a C# or Visual Basic project in Visual Studio 2019.":::
88
+
89
+
1. To apply the property change, close the **Properties** pane.
90
+
91
+
> [!NOTE]
92
+
> For a .NET Core app in Visual Studio 2017 and Visual Studio 2019, you must use the *launchSettings.json* file instead of the project properties to enable mixed-mode debugging.
93
+
94
+
::: moniker-end
95
+
::: zone-end
96
+
97
+
::: zone pivot="programming-language-dotnetf"
98
+
## Enable mixed-mode for managed calling app (C# or Visual Basic)
99
+
100
+
To enable mixed-mode debugging for a managed calling app in C# or Visual Basic, follow these steps:
101
+
102
+
1. In Visual Studio **Solution Explorer**, right-click the C# or Visual Basic project and select **Properties**, or use the Alt + Enter keyboard shortcut. The **Properties** pane opens.
103
+
104
+
1. In the **Properties** pane, enable mixed-mode debugging by setting the following property:
105
+
106
+
::: moniker range=">=vs-2022"
107
+
76
108
**.NET Framework code**
77
109
78
110
If you're using .NET Framework code, which has no debug launch profile, follow these steps:
@@ -100,6 +132,7 @@ To enable mixed-mode debugging for a managed calling app in C# or Visual Basic,
100
132
> For a .NET Core app in Visual Studio 2017 and Visual Studio 2019, you must use the *launchSettings.json* file instead of the project properties to enable mixed-mode debugging.
0 commit comments