Skip to content

Commit 9ceaf69

Browse files
authored
Merge pull request #3083 from MicrosoftDocs/master
10/12 AM Publish
2 parents 40b6438 + 98825fa commit 9ceaf69

File tree

5,267 files changed

+5565
-15528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,267 files changed

+5565
-15528
lines changed
Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "How to: Debug from a DLL Project | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "05/24/2017"
4+
ms.date: "05/24/2018"
55
ms.technology: "vs-ide-debug"
66
ms.topic: "conceptual"
77
dev_langs:
@@ -21,63 +21,64 @@ manager: douge
2121
ms.workload:
2222
- "multiple"
2323
---
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
2825

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

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

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

45-
![Debugging Properties Window](../debugger/media/dbg-debugging-properties-dll.png "DebuggingPropertiesWindow")
46-
47-
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**.
37+
38+
1. Select **Configuration Properties** > **Debugging**.
39+
40+
1. In the **Debugger to launch** list, choose either **Local Windows Debugger** or **Remote Windows Debugger**.
41+
42+
1. In the **Command** or **Remote Command** box, add the fully qualified path and filename of the calling app, such as an *.exe* file.
43+
44+
![Debug Properties window](../debugger/media/dbg-debugging-properties-dll.png "Debug Properties window")
45+
46+
1. Add any necessary program arguments to the **Command Arguments** box.
47+
48+
1. Select **OK**.
5249

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.
65+
66+
![C# Debug Properties window](../debugger/media/dbg-debugging-properties-dll-csharp.png "C# Debug Properties window")
67+
68+
1. Use **File** > **Save Selected Items** or **Ctrl**+**S** to save changes.
5469

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

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.
60-
61-
![Debugging Properties Window](../debugger/media/dbg-debugging-properties-dll-csharp.png "DebuggingPropertiesWindow")
62-
63-
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**.
7075

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**.
7677

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

79-
## See Also
80-
[Debugging DLL Projects](../debugger/debugging-dll-projects.md)
81-
[Project Settings for C# Debug Configurations](../debugger/project-settings-for-csharp-debug-configurations.md)
82-
[Project Settings for a Visual Basic Debug Configuration](../debugger/project-settings-for-a-visual-basic-debug-configuration.md)
83-
[Project Settings for a C++ Debug Configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md)
80+
## See also
81+
[Debugging DLL projects](../debugger/debugging-dll-projects.md)
82+
[Project settings for C# debug configurations](../debugger/project-settings-for-csharp-debug-configurations.md)
83+
[Project settings for a Visual Basic debug configuration](../debugger/project-settings-for-a-visual-basic-debug-configuration.md)
84+
[Project settings for a C++ debug configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md)
Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "How to: Debug in Mixed Mode | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "06/19/2017"
4+
ms.date: "06/19/2018"
55
ms.technology: "vs-ide-debug"
66
ms.topic: "conceptual"
77
dev_langs:
@@ -20,39 +20,41 @@ manager: douge
2020
ms.workload:
2121
- "multiple"
2222
---
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:
2525

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

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

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

45-
![Enable mixed mode debugging](../debugger/media/dbg-mixed-mode-from-native.png "Enable mixed mode debugging")
34+
> [!NOTE]
35+
> 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).
4636
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**.
44+
45+
1. Select **OK**.
46+
47+
![Enable mixed mode debugging](../debugger/media/dbg-mixed-mode-from-native.png "Enable mixed mode debugging")
48+
49+
## Enable mixed-mode debugging for a managed calling app
5250

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

55-
![Enable native code debugging](../debugger/media/dbg-mixed-mode-from-csharp.png "Enable native code debugging")
57+
![Enable native code debugging](../debugger/media/dbg-mixed-mode-from-csharp.png "Enable native code debugging")
5658

57-
## See Also
58-
[How to: Debug from a DLL Project](../debugger/how-to-debug-from-a-dll-project.md)
59+
## See also
60+
[How to: Debug from a DLL project](../debugger/how-to-debug-from-a-dll-project.md)

0 commit comments

Comments
 (0)