Skip to content

Commit 800321b

Browse files
Merge pull request #13802 from Mikejo5000/mikejo-br25
Update instructions for creating a new project
2 parents 1840c45 + 439a03e commit 800321b

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

docs/debugger/how-to-debug-managed-and-native-code.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Tutorial: Debug C# and C++ code (mixed mode)"
33
description: Debug a native DLL from a .NET Core or .NET Framework application by using mixed-mode debugging to enable more than one debugger type in a debugging session.
4-
ms.date: 09/18/2024
4+
ms.date: 04/07/2025
55
ms.topic: tutorial
66
dev_langs:
77
- "CSharp"
@@ -54,7 +54,13 @@ If you have Visual Studio installed, but don't have the workloads you need, sele
5454

5555
1. Open Visual Studio and create a project.
5656

57+
::: moniker range=">=vs-2022"
58+
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **Empty Project**, and then select the **Empty Project** for C++. In the **Configure your new project** dialog box that appears, type a name like **Mixed_Mode_Debugging** and click **Create**.
59+
::: moniker-end
60+
61+
::: moniker range="vs-2019"
5762
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **Empty Project**, choose **Templates**, then choose **Empty Project** for C++. In the dialog box that appears, choose **Create**. Then, type a name like **Mixed_Mode_Debugging** and click **Create**.
63+
::: moniker-end
5864

5965
If you don't see the **Empty Project** project template, go to **Tools** > **Get Tools and Features...**, which opens the Visual Studio Installer. The Visual Studio Installer launches. Choose the **Desktop development with C++** workload, then choose **Modify**.
6066

@@ -124,11 +130,17 @@ If you have Visual Studio installed, but don't have the workloads you need, sele
124130
125131
1. Open Visual Studio and create a new project.
126132
133+
::: moniker range=">=vs-2022"
134+
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **console**, and then select the C# **Console App** for .NET or .NET Framework.
135+
::: moniker-end
136+
137+
::: moniker range="vs-2019"
127138
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **console**, choose **Templates**, and then choose **Console App** for .NET Core or **Console App (.NET Framework)** for C#. In the dialog box that appears, choose **Next**.
139+
::: moniker-end
128140
129141
Then, type a name like **Mixed_Mode_Calling_App** and click **Next** or **Create**, whichever option is available.
130142
131-
For .NET Core, choose either the recommended target framework or .NET 8, and then choose **Create**.
143+
For .NET Core or .NET 5+, choose either the recommended target framework or .NET 8, and then choose **Create**.
132144
133145
If you don't see the correct project template, go to **Tools** > **Get Tools and Features...**, which opens the Visual Studio Installer. Choose the correct .NET workload as described in the prerequisites, and then choose **Modify**.
134146

docs/debugger/quickstart-debug-with-cplusplus.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debug C++ code, set breakpoints, inspect variables
33
description: Debug native C++ code by using the Visual Studio debugger, create a project, set breakpoints, inspect variables, and edit code while debugging.
4-
ms.date: 08/06/2018
4+
ms.date: 04/07/2025
55
ms.topic: quickstart
66
helpviewer_keywords:
77
- "debugger"
@@ -18,7 +18,7 @@ The Visual Studio debugger provides many powerful features to help you debug you
1818

1919
1. Open Visual Studio and create a project.
2020

21-
On the Welcome Page, select **Create a new project**. Select **Empty Project**. Make sure you are selecting the Project Template for C++.
21+
If the Start window isn't already open, select **File > Start Window**. In the Start window, select **Create a new project**. In the search box, type "Empty project", and then select the C++ **Empty Project** template.
2222

2323
If you don't see the project template, open the **Visual Studio Installer**. Choose the **Desktop development with C++ workload**, then choose **Modify**.
2424

@@ -35,7 +35,7 @@ The Visual Studio debugger provides many powerful features to help you debug you
3535
}
3636
```
3737

38-
with this code (do not remove `#include "stdafx.h"`):
38+
with this code (don't remove `#include "stdafx.h"`):
3939

4040
```cpp
4141
#include <list>
@@ -66,7 +66,7 @@ The Visual Studio debugger provides many powerful features to help you debug you
6666

6767
## Set a breakpoint
6868

69-
A *breakpoint* is a marker that indicates where Visual Studio should suspend your running code so you can take a look at the values of variables, or the behavior of memory, or whether or not a branch of code is getting run. It is the most basic feature in debugging.
69+
A *breakpoint* is a marker that indicates where Visual Studio should suspend your running code so you can take a look at the values of variables, or the behavior of memory, or whether or not a branch of code is getting run. It's the most basic feature in debugging.
7070

7171
1. To set the breakpoint, click in the gutter to the left of the `doWork` function call (or select the line of code and press **F9**).
7272

@@ -76,7 +76,7 @@ A *breakpoint* is a marker that indicates where Visual Studio should suspend you
7676

7777
![Hit a breakpoint](../debugger/media/dbg-qs-hit-breakpoint.png "Hit a breakpoint")
7878

79-
The debugger pauses where you set the breakpoint. The statement where the debugger and app execution is paused is indicated by the yellow arrow. The line with the `doWork` function call has not yet executed.
79+
The debugger pauses where you set the breakpoint. The statement where the debugger and app execution is paused is indicated by the yellow arrow. The line with the `doWork` function call hasn't yet executed.
8080

8181
> [!TIP]
8282
> If you have a breakpoint in a loop or recursion, or if you have many breakpoints that you frequently step through, use a [conditional breakpoint](../debugger/using-breakpoints.md#BKMK_Specify_a_breakpoint_condition_using_a_code_expression) to make sure that your code is suspended ONLY when specific conditions are met. A conditional breakpoint saves time and can also make it easier to debug issues that are hard to reproduce.

docs/debugger/walkthrough-writing-a-visualizer-in-visual-basic.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ms.subservice: debug-diagnostics
2121
> [!IMPORTANT]
2222
> Starting with Visual Studio 2022 version 17.9, visualizers can now be written in .NET 6.0+ that run out-of-process using the new VisualStudio.Extensibility model. We encourage visualizer authors to reference the new documentation at [Create Visual Studio debugger visualizers](../extensibility/visualstudio.extensibility/debugger-visualizer/debugger-visualizers.md) unless they want to support older versions of Visual Studio or want to ship their custom visualizers as part of a library DLL.
2323
24-
This walkthrough shows how to write a simple visualizer by using Visual Basic. The visualizer you will create in this walkthrough displays the contents of a string using a Windows Forms message box. This simple string visualizer is a basic example to show how you can create visualizers for other data types more applicable to your projects.
24+
This walkthrough shows how to write a simple visualizer by using Visual Basic. The visualizer you'll create in this walkthrough displays the contents of a string using a Windows Forms message box. This simple string visualizer is a basic example to show how you can create visualizers for other data types more applicable to your projects.
2525

2626
> [!NOTE]
2727
> 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, go to the **Tools** menu and choose **Import and Export** . For more information, see [Reset settings](../ide/personalizing-the-visual-studio-ide.md#reset-all-settings).
@@ -34,7 +34,13 @@ Visualizer code must be placed in a DLL that will be read by the debugger. The f
3434

3535
1. Create a new class library project.
3636

37-
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **visual basic**, choose **Templates**, then choose **Create a new Class Library (.NET Framework)**. In the dialog box that appears, choose **Create**.
37+
::: moniker range=">=vs-2022"
38+
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **class library**, and then select the Visual Basic **Class Library (.NET Framework)**.
39+
::: moniker-end
40+
41+
::: moniker range="vs-2019"
42+
Press **Esc** to close the start window. Type **Ctrl + Q** to open the search box, type **visual basic**, choose **Templates**, then choose **Create a new Class Library (.NET Framework)**.
43+
::: moniker-end
3844

3945
2. Type an appropriate name for the class library, such as `MyFirstVisualizer`, and then click **Create** or **OK**.
4046

@@ -64,7 +70,7 @@ Visualizer code must be placed in a DLL that will be read by the debugger. The f
6470
```
6571

6672
## Add the Debugger-side Code
67-
Now, you are ready to create the debugger-side code. This is the code that runs within the debugger to display the information that you want to visualize. First, you have to change the declaration of the `DebuggerSide` object so that it inherits from the base class `DialogDebuggerVisualizer`.
73+
Now, you're ready to create the debugger-side code. This is the code that runs within the debugger to display the information that you want to visualize. First, you have to change the declaration of the `DebuggerSide` object so that it inherits from the base class `DialogDebuggerVisualizer`.
6874

6975
### To inherit from DialogDebuggerVisualizer
7076

@@ -96,7 +102,7 @@ Visualizer code must be placed in a DLL that will be read by the debugger. The f
96102
End Sub
97103
```
98104

99-
The `Show` method contains the code that actually creates the visualizer dialog box, or other user interface, and displays the information that has been passed to the visualizer from the debugger. You must add the code that creates the dialog box and displays the information. In this walkthrough, you will do this using a Windows Forms message box. First, you must add a reference and `Imports` statement for <xref:System.Windows.Forms>.
105+
The `Show` method contains the code that actually creates the visualizer dialog box, or other user interface, and displays the information that has been passed to the visualizer from the debugger. You must add the code that creates the dialog box and displays the information. In this walkthrough, you'll do this using a Windows Forms message box. First, you must add a reference and `Imports` statement for <xref:System.Windows.Forms>.
100106

101107
### To add System.Windows.Forms
102108

@@ -115,7 +121,7 @@ Visualizer code must be placed in a DLL that will be read by the debugger. The f
115121
```
116122

117123
## Create Your Visualizer's User Interface
118-
Now you will add some code to create and show the user interface for your visualizer. Because this is your first visualizer, you will keep the user interface simple and use a Message Box.
124+
Now you'll add some code to create and show the user interface for your visualizer. Because this is your first visualizer, you'll keep the user interface simple and use a Message Box.
119125

120126
### To show the visualizer output in a dialog box
121127

@@ -125,12 +131,12 @@ Visualizer code must be placed in a DLL that will be read by the debugger. The f
125131
MessageBox.Show(objectProvider.GetObject().ToString())
126132
```
127133

128-
This example code does not include error handling. You should include error handling in a real visualizer, or any other kind of application.
134+
This example code doesn't include error handling. You should include error handling in a real visualizer, or any other kind of application.
129135

130136
2. On the **Build** menu, click **Build MyFirstVisualizer**. The project should build successfully. Correct any build errors before continuing.
131137

132138
## Add the Necessary Attribute
133-
That is the end of the debugger-side code. There is one more step, however: the attribute that tells the debuggee side which collection of classes comprises the visualizer.
139+
That is the end of the debugger-side code. There's one more step, however: the attribute that tells the debuggee side which collection of classes comprises the visualizer.
134140

135141
### To add the type to visualize for the debuggee-side code
136142

@@ -145,7 +151,7 @@ In the debugger-side code, you specify the type to visualize (the object source)
145151
2. On the **Build** menu, click **Build MyFirstVisualizer**. The project should build successfully. Correct any build errors before continuing.
146152

147153
## Create a Test Harness
148-
At this point, your first visualizer is finished. If you have followed the steps correctly, you can build the visualizer and install it into Visual Studio. Before you install a visualizer into Visual Studio, however, you should test it to make sure that it runs correctly. You will now create a test harness to run the visualizer without installing it into Visual Studio.
154+
At this point, your first visualizer is finished. If you have followed the steps correctly, you can build the visualizer and install it into Visual Studio. Before you install a visualizer into Visual Studio, however, you should test it to make sure that it runs correctly. you'll now create a test harness to run the visualizer without installing it into Visual Studio.
149155

150156
### To add a test method to show the visualizer
151157

@@ -187,7 +193,7 @@ In the debugger-side code, you specify the type to visualize (the object source)
187193
6. Click **OK**.
188194

189195
## Finish Your Test Harness and Test Your Visualizer
190-
Now, you will add the code to finish the test harness.
196+
Now, you'll add the code to finish the test harness.
191197

192198
### To add code to MyTestConsole
193199

@@ -210,7 +216,7 @@ In the debugger-side code, you specify the type to visualize (the object source)
210216
DebuggerSide.TestShowVisualizer(myString)
211217
```
212218

213-
Now you are ready to test your first visualizer.
219+
Now you're ready to test your first visualizer.
214220

215221
### To test the visualizer
216222

0 commit comments

Comments
 (0)