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
title: "How to: Debug from a DLL Project | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "05/24/2017"
4
+
ms.date: "05/24/2018"
5
5
ms.technology: "vs-ide-debug"
6
6
ms.topic: "conceptual"
7
7
dev_langs:
@@ -21,63 +21,64 @@ manager: douge
21
21
ms.workload:
22
22
- "multiple"
23
23
---
24
-
# How to: Debug from a DLL Project in Visual Studio
25
-
One way to debug a DLL project is to specify the calling application in the project properties of the DLL project and then you can start debugging from the DLL project itself. For this method to work, the application must call the DLL, and the DLL must be in the location where the application expects to find it (otherwise, the application might find a different version of the DLL and load that instead, and it won't hit your breakpoints). For other methods of debugging DLLs, see [Debugging DLL Projects](../debugger/debugging-dll-projects.md).
26
-
27
-
If a managed DLL is called by native code and you want to debug both, you can specify this in the project properties. For more information, see [How to: Debug in Mixed Mode](../debugger/how-to-debug-in-mixed-mode.md).
24
+
# How to: Debug from a DLL project in Visual Studio
28
25
29
-
The C++ property pages differ in layout and content from the C# and Visual Basic property pages.
30
-
31
-
### To specify the calling application in a C++ project
32
-
33
-
1. Right-click the project node in the **Solution Explorer** and select **Properties**.
26
+
One way to debug a DLL project is to specify the calling app in the DLL project properties. Then you can start debugging from the DLL project itself. For this method to work, the app must call the same DLL in the same location as the one you configure. If the app finds and loads a different version of the DLL, that version won't contain your breakpoints. For other methods of debugging DLLs, see [Debugging DLL projects](../debugger/debugging-dll-projects.md).
34
27
35
-
2. Make sure that the **Configuration** field at the top of the window is set to **Debug**.
28
+
If your managed app calls a native DLL, or your native app calls a managed DLL, you can debug both the DLL and the calling app. For more information, see [How to: Debug in mixed mode](../debugger/how-to-debug-in-mixed-mode.md).
36
29
37
-
A **Debug** configuration is required for this method.
38
-
39
-
3. Go to **Configuration Properties > Debugging**.
40
-
41
-
4. In the **Debugger to launch** list, choose **Local Windows Debugger** or **Remote Windows Debugger**.
42
-
43
-
5. In the **Command** or **Remote Command** box, add the fully-qualified path name of the calling application (such as an .exe file).
30
+
Native and managed DLL projects have different settings to specify calling apps.
6. Add any necessary program arguments to the **Command Arguments** box.
48
-
49
-
### To specify the calling application in a C# or Visual Basic project
50
-
51
-
1. Right-click the project node in the **Solution Explorer** and select **Properties**, and then select the **Debug** tab.
32
+
## Specify a calling app in a native DLL project
33
+
34
+
1. Select the C++ DLL project in **Solution Explorer**. Select the **Properties** icon, press **Alt**+**Enter**, or right-click and choose **Properties**.
35
+
36
+
1. In the **\<Project> Property Pages** dialog box, make sure the **Configuration** field at the top of the window is set to **Debug**.
1. Add any necessary program arguments to the **Command Arguments** box.
47
+
48
+
1. Select **OK**.
52
49
53
-
2. Make sure that the **Configuration** field at the top of the window is set to **Debug**.
50
+
## Specify a calling app in a managed DLL project
51
+
52
+
1. Select the C# or Visual Basic DLL project in **Solution Explorer**. Select the **Properties** icon, press **Alt**+**Enter**, or right-click and choose **Properties**.
53
+
54
+
1. Make sure that the **Configuration** field at the top of the window is set to **Debug**.
55
+
56
+
1. Under **Start action**:
57
+
58
+
- For .NET Framework DLLs, select **Start external program**, and add the fully qualified path and name of the calling app.
59
+
60
+
- Or, select **Start browser with URL** and fill in the URL of a local ASP.NET app.
61
+
62
+
- For .NET Core DLLs, the **Debug** Properties page is different. Select **Executable** from the **Launch** dropdown, and then add the fully qualified path and name of the calling app in the **Executable** field.
63
+
64
+
1. Add any necessary command-line arguments in the **Command line arguments** or **Application arguments** field.
1. Use **File** > **Save Selected Items** or **Ctrl**+**S** to save changes.
54
69
55
-
3. (.NET Framework) Select **Start external program**, and add the fully-qualified path name of the calling application.
70
+
## Debug from the DLL project
71
+
72
+
1. Set breakpoints in the DLL project.
56
73
57
-
4. (.NET Core) Select **Executable** from the **Launch** list, and then add the fully-qualified path name of the calling application in the **Executable** field.
58
-
59
-
If you need to add the external program's command line arguments, add them in the **Command line arguments** (or **Application arguments**) field.
5. If you need to, you can also call an application as a URL. (You might want to do this if you are debugging a managed DLL used by a local ASP.NET application.)
64
-
65
-
Under **Start Action**, select the **Start browser with URL:** radio button and fill in the URL.
66
-
67
-
### To start debugging from the DLL project
68
-
69
-
1. Set breakpoints in the DLL project.
74
+
1. Right-click the DLL project and choose **Set as Startup Project**.
70
75
71
-
2. Right-click the DLL project and choose **Set as Startup Project**.
72
-
73
-
(Also, make sure that the **Solutions Configuration** field is still set to **Debug**.)
74
-
75
-
3. Start debugging (press F5, click the green arrow, or click **Debug > Start Debugging**).
76
+
1. Make sure the **Solutions Configuration** field is set to **Debug**. Press **F5**, click the green **Start** arrow, or select **Debug** > **Start Debugging**.
76
77
77
-
You will hit the breakpoints in your DLL. If you aren't able to hit the breakpoints, make sure that your DLL output (by default, the **project\Debug** folder) is in a location that the calling application expects to find it.
78
+
If debugging does not hit your breakpoints, make sure that your DLL output (by default, the *\<project>\Debug* folder) is the location that the calling app is calling.
title: "How to: Debug in Mixed Mode | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "06/19/2017"
4
+
ms.date: "06/19/2018"
5
5
ms.technology: "vs-ide-debug"
6
6
ms.topic: "conceptual"
7
7
dev_langs:
@@ -20,39 +20,41 @@ manager: douge
20
20
ms.workload:
21
21
- "multiple"
22
22
---
23
-
# How to: Debug in Mixed Mode
24
-
The following procedures describe how to debug both managed and native code, also known as mixed-mode debugging. There are two scenarios for doing so, depending on whether the DLL or the application is written in native code:
23
+
# How to: Debug in mixed mode
24
+
The following procedures describe how to enable debugging for managed and native code together, also known as mixed-mode debugging. There are two mixed-mode debugging scenarios:
25
25
26
-
-The calling application that calls your DLL is written in native code. In this case your DLL is managed, and both managed and native debuggers must be enabled to debug both. You can check this in the **\<Project> Property Pages** dialog box. How you do this depends on whether you start debugging from the DLL project or the calling application project.
26
+
- The app that calls a DLL is written in native code, and the DLL is managed.
27
27
28
-
- The calling application that calls your DLL is written in managed code and your DLL is written in native code. For a tutorial that walks you through these steps, see [Debug managed and native code](../debugger/how-to-debug-managed-and-native-code.md).
29
-
30
-
> [!NOTE]
31
-
> The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose **Import and Export Settings** on the **Tools** menu. For more information, see [Personalize the Visual Studio IDE](../ide/personalizing-the-visual-studio-ide.md).
28
+
- The app that calls a DLL is written in managed code, and the DLL is in native code. For a tutorial that walks you through this scenario in more detail, see [Debug managed and native code](../debugger/how-to-debug-managed-and-native-code.md).
29
+
30
+
You can enable both managed and native debuggers in the calling app project's **Property** pages. The settings differ between native and managed apps.
32
31
33
-
If you don't have access to the project for the calling app, you can debug a DLL from the DLL project. For more information, see [How to: Debug from a DLL Project](../debugger/how-to-debug-from-a-dll-project.md). You don't need to use mixed to debug just the DLL project.
34
-
35
-
### To enable mixed-mode debugging (C++ calling app)
36
-
37
-
1. In **Solution Explorer**, select the native project.
38
-
39
-
2. On the **View** menu, click **Property Pages**.
40
-
41
-
3. In the **\<Project> Property Pages** dialog box, expand the **Configuration Properties** node, and then select **Debugging**.
42
-
43
-
4. Set **Debugger Type** to **Mixed** or **Auto**.
32
+
If you don't have access to a calling app's project, you can debug the DLL from the DLL project. You don't need mixed mode to debug just the DLL project. For more information, see [How to: Debug from a DLL project](../debugger/how-to-debug-from-a-dll-project.md).
> The dialog boxes and commands you see might differ from the ones in this article, depending on your Visual Studio settings or edition. To change your settings, choose **Tools** > **Import and Export Settings**. For more information, see [Personalize the Visual Studio IDE](../ide/personalizing-the-visual-studio-ide.md).
46
36
47
-
### To enable mixed-mode debugging (C# or VB calling app)
48
-
49
-
1. In **Solution Explorer**, select the managed project.
50
-
51
-
2. On the **View** menu, click **Property Pages**.
37
+
## Enable mixed-mode debugging for a native calling app
38
+
39
+
1. Select the C++ project in **Solution Explorer** and click the **Properties** icon, press **Alt**+**Enter**, or right-click and choose **Properties**.
40
+
41
+
1. In the **\<Project> Property Pages** dialog box, expand **Configuration Properties**, and then select **Debugging**.
42
+
43
+
1. Set **Debugger Type** to **Mixed** or **Auto**.
## Enable mixed-mode debugging for a managed calling app
52
50
53
-
3. In the **\<Project> Property Pages** dialog box, select the **Debug** tab, and then select **Enable native code debugging**
51
+
1. Select the C# or Visual Basic project in **Solution Explorer** and select the **Properties** icon, press **Alt**+**Enter**, or right-click and choose **Properties**.
52
+
53
+
1. Select the **Debug** tab, and then select **Enable native code debugging**.
54
+
55
+
1. Use **File** > **Save Selected Items** or **Ctrl+S** to save changes.
0 commit comments