Skip to content

Commit 77408a1

Browse files
authored
Merge pull request #3067 from v-thepet/debugger1
Refresh three articles
2 parents 5cf9dfa + d332f10 commit 77408a1

File tree

3 files changed

+100
-96
lines changed

3 files changed

+100
-96
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)
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "View strings in a string visualizer | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "07/11/2017"
4+
ms.date: "07/11/2018"
55
ms.technology: "vs-ide-debug"
66
ms.topic: "reference"
77
f1_keywords:
@@ -24,41 +24,42 @@ ms.workload:
2424
- "multiple"
2525
---
2626
# View strings in a string visualizer in Visual Studio
27-
While you are debugging, you can open a string visualizer to view strings that are too long to view in a data tip or debugger window. In many scenarios, the visualizer can help you to identify malformed strings.
2827

29-
The standard built-in string visualizers include plain text, XML, HTML, and JSON. For a few other types such as WPF objects that appear in the debugger windows like the **Autos** window, you can also open visualizers.
28+
While you are debugging in Visual Studio, you can view strings with the built-in string visualizer. The string visualizer shows strings that are too long for a data tip or debugger window. It can also help you identify malformed strings.
29+
30+
The built-in string visualizer includes plain text, XML, HTML, and JSON options. You can also open visualizers for a few other types, such as WPF objects, from the **Autos** or other debugger windows.
3031

3132
## Open a string visualizer
3233

33-
To view a plain text, XML, HTML, or JSON string, click the magnifying glass icon ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon") while hovering over a variable containing a string value. You must be paused in the debugger to see the magnifying glass icon.
34+
To open the string visualizer, you must be paused during debugging. Hover over a variable that has a plain text, XML, HTML, or JSON string value, and select the magnifying glass icon ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon").
3435

35-
![Open a String Visualizer](../debugger/media/dbg-tips-string-visualizers.png "OpenStringVisualizer")
36+
![Open a string visualizer](../debugger/media/dbg-tips-string-visualizers.png "Open string visualizer")
3637

37-
## View string data
38+
## View string visualizer data
3839

39-
The **Expression** field in the string visualizer shows the current variable or expression you hovered over in the debugger.
40+
In the string visualizer window, the **Expression** field shows the variable or expression you're hovering over, and the **Value** field shows the string value.
4041

41-
The **Value** field shows the string value. The Text visualizer shows the plain text.
42+
A blank **Value** means that the chosen visualizer can't recognize the string. For example, the **XML Visualizer** shows a blank **Value** for a text string with no XML tags, or a JSON string.
4243

43-
A blank **Value** indicates that the specific visualizer cannot recognize the string type. For example, the XML visualizer shows a blank **Value** for a simple text string (with no XML tags) or a JSON formatted string. If you need to view an unrecognizable string in a visualizer, use the text visualizer.
44+
To view strings that the chosen visualizer can't recognize, choose the **Text Visualizer**. The **Text Visualizer** shows plain text.
4445

4546
### View JSON string data
4647

47-
A well-formed JSON string will appear similar to the following illustration in the JSON visualizer. Malformed JSON may display an error icon (or blank if unrecognized). If you see an error icon, copy and paste the JSON string into a JSON linting tool such as [JSLint](https://www.jslint.com/) to identify the JSON error.
48+
A well-formed JSON string appears similar to the following illustration in the JSON visualizer. Malformed JSON may display an error icon (or blank if unrecognized). To identify the JSON error, copy and paste the string into a JSON linting tool such as [JSLint](https://www.jslint.com/).
4849

49-
![JSON String Visualizer](../debugger/media/dbg-tips-string-visualizer-json.png "JSON String Visualizer")
50+
![JSON string visualizer](../debugger/media/dbg-tips-string-visualizer-json.png "JSON string visualizer")
5051

5152
### View XML string data
5253

53-
A well-formed XML string will appear similar to the following illustration in the XML visualizer. Malformed XML may display without the XML tags (or blank if unrecognized).
54+
A well-formed XML string appears similar to the following illustration in the XML visualizer. Malformed XML may display without the XML tags, or blank if unrecognized.
5455

5556
![XML String Visualizer](../debugger/media/dbg-string-visualizers-xml.png "XML String Visualizer")
5657

5758
### View HTML string data
5859

59-
A well-formed HTML string appears similar to the view you would see if the string is rendered in a browser, as shown in following illustration. Malformed HTML may display as plain text.
60+
A well-formed HTML string appears as if rendered in a browser, as shown in the following illustration. Malformed HTML may display as plain text.
6061

61-
![HTML String Visualizer](../debugger/media/dbg-string-visualizers-html.png "HTML String Visualizer")
62+
![HTML string visualizer](../debugger/media/dbg-string-visualizers-html.png "HTML String Visualizer")
6263

63-
## See Also
64-
[Create Custom Visualizers (C#, Visual Basic)](../debugger/create-custom-visualizers-of-data.md)
64+
## See also
65+
[Create custom visualizers (C#, Visual Basic)](../debugger/create-custom-visualizers-of-data.md)

0 commit comments

Comments
 (0)