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/remote-debugging-azure-app-service.md
+8-4Lines changed: 8 additions & 4 deletions
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: "Remote Debug ASP.NET Core on Azure App Service"
3
3
description: Configure Azure App Service for remote debugging and attach the remote debugger from Visual Studio to debug the app as though it's running locally.
4
-
ms.date: 04/23/2024
4
+
ms.date: 11/21/2025
5
5
ms.topic: article
6
6
author: "mikejo5000"
7
7
ms.author: "mikejo"
@@ -20,8 +20,6 @@ This article describes how to attach the Visual Studio debugger to an ASP.NET Co
20
20
21
21
- You must first deploy an ASP.NET Core app to Azure App Service (Windows) from Visual Studio, and the app must be running.
22
22
23
-
For hands-on training that includes App Service deployment, see [Remote debug ASP.NET Core on Azure](/training/modules/dotnet-debug-visual-studio-azure-web-apps/).
24
-
25
23
- Your publish profile in Visual Studio must be set to Debug instead of Release before publishing.
26
24
27
25
## Enable remote debugging
@@ -51,11 +49,17 @@ Your app service instance now supports remote debugging through Visual Studio.
51
49
> [!NOTE]
52
50
> Make sure the state of your local code matches what was deployed to Azure. This ensures that the local symbol files and source code line up with the deployed app.
53
51
54
-
1. Select **Debug > Options** from the top Visual Studio menu. Ensure that **Enable Just My code** is *unchecked* (as shown below), and then select **OK**.
52
+
1. Select **Debug > Options** from the top Visual Studio menu. Ensure that **Enable Just My code** is *unchecked* (as shown in the following illustration), and then select **OK**.
55
53
56
54
Changing this setting allows Visual Studio to debug the optimized code that was deployed to Azure using the necessary symbol files from your local bin folder. Symbol files are used by the debugger as a bridge between compiled, executing code and the source code in Visual Studio. Matching symbol files are required for remote debugging.
57
55
56
+
::: moniker range="visualstudio"
57
+
:::image type="content" source="../debugger/media/visualstudio/visual-studio-remote-debug-settings.png" alt-text="A screenshot of the Visual Studio debugging settings.":::
58
+
::: moniker-end
59
+
60
+
::: moniker range="vs-2022"
58
61
:::image type="content" source="../debugger/media/vs-2022/visual-studio-remote-debug-settings.png" alt-text="A screenshot of the Visual Studio debugging settings.":::
Copy file name to clipboardExpand all lines: docs/profiling/profiling-with-benchmark-dotnet.md
+34-27Lines changed: 34 additions & 27 deletions
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: "Analyze BenchmarkDotNet data in Visual Studio"
3
3
description: Learn how to profile console apps using BenchmarkDotNet.
4
-
ms.date: 11/10/2025
4
+
ms.date: 11/24/2025
5
5
ms.topic: how-to
6
6
dev_langs:
7
7
- "CSharp"
@@ -17,19 +17,9 @@ monikerRange: '>= vs-2022'
17
17
18
18
# Analyze BenchmarkDotNet data in Visual Studio
19
19
20
-
You can use the profiling tools to collect and view [BenchmarkDotNet](https://benchmarkdotnet.org/articles/overview.html) data in Visual Studio.
20
+
You can use the profiling tools to collect and view [BenchmarkDotNet](https://benchmarkdotnet.org/articles/overview.html) data in Visual Studio. BenchmarkDotNet is an open-source .NET library designed for performance benchmarking. It automates the process of measuring and comparing the execution time, memory usage, and other performance metrics of your .NET code in a reliable and repeatable way.
21
21
22
-
When you add a BenchmarkDotNet diagnoser to your benchmark classes as an attribute, a *.diagsession* file is generated after the benchmark runs. You can then open the *.diagsession* in Visual Studio and view profiling data for the benchmarks.
23
-
24
-
The following diagnosers are supported:
25
-
26
-
- CPUUsageDiagnoser
27
-
- DatabaseDiagnoser
28
-
- DotNetCountersDiagnoser
29
-
- EventsDiagnoser
30
-
- FileIODiagnoser
31
-
32
-
Each diagnoser generates performance data related to that diagnoser. For example, the CPUUsageDiagnoser generates a *.diagsession* file with CPU data in it, and the DatabaseDiagnoser generates a *.diagsession* file with data on database operations. Limitations correspond to the associated profiling tool. For example, the profiler's Database tool works on [ADO.NET](/dotnet/framework/data/adonet/ado-net-overview) or [Entity Framework Core](/ef/core/).
22
+
You use BenchmarkDotNet by installing required NuGet packages in your project and then adding attributes to your code that match the type of performance information you are interested in.
33
23
34
24
## Prerequisites
35
25
@@ -44,30 +34,45 @@ Each diagnoser generates performance data related to that diagnoser. For example
44
34
If you use the Benchmark project template, these NuGet packages are present when you create the project.
45
35
::: moniker-end
46
36
47
-
## Create your project
37
+
## Set up your project
48
38
49
39
::: moniker range=">=visualstudio"
50
-
The benchmark functions must be added to a .NET console application. These functions can be wrapper functions that reference other project types.
40
+
The benchmark attributes must be added to a .NET console application. The attributes can be added to wrapper functions that reference other project types.
51
41
52
-
You can either create a console project and add BenchmarkDotNet support manually, or use the **Benchmark Project** template. Some of the steps described in this article are required only when you manually add BenchmarkDotNet support.
42
+
To prepare your project for BenchmarkDotNet support, use one of the following methods:
53
43
54
-
The **Benchmark Project** template generates a fully integrated BenchmarkDotNet project with built-in support for CPU Usage profiling and Copilot insights. To use the template, select **Profiling** from the project types list when you create a new project, and then choose **Benchmark Project**.
44
+
- Open an existing console project or create a new console project. In this scenario, you manually add BenchmarkDotNet support.
45
+
- Use the **Benchmark Project** template. Some of the steps described in this article are required only when you manually add BenchmarkDotNet support.
46
+
47
+
The **Benchmark Project** template generates a fully integrated BenchmarkDotNet project with built-in support for CPU Usage profiling and Copilot insights. To use the template, select **Profiling** from the project types list when you create a new project, and then choose **Benchmark Project**. For information about attributes, see [Attribute your code](#attribute-your-code).
55
48
56
49

57
50
::: moniker-end
58
51
::: moniker range="vs-2022"
59
-
Create a console project.
52
+
Create a console project or use an existing console project.
60
53
61
-
The benchmark functions must be added to a .NET console application. These functions can be wrapper functions that reference other project types.
54
+
The benchmark attributes must be added to a .NET console application. The attributes can be added to wrapper functions that reference other project types.
62
55
::: moniker-end
63
56
64
-
## Collect Benchmark.NET data
57
+
## Attribute your code
58
+
59
+
When you add a BenchmarkDotNet diagnoser to your benchmark classes as an attribute, you configure the app to generate a *.diagsession* file after the benchmarks run. You can then open the *.diagsession* file in Visual Studio and view profiling data for the benchmarks.
60
+
61
+
The following diagnosers are supported:
65
62
66
-
1. Set your build to a Release build instead of a Debug build.
63
+
- CPUUsageDiagnoser
64
+
- DatabaseDiagnoser
65
+
- DotNetCountersDiagnoser
66
+
- EventsDiagnoser
67
+
- FileIODiagnoser
67
68
68
-
1. Attribute your code for diagnosers and benchmarks, and include code to run the benchmarks (`BenchmarkRunner.Run`).
69
+
Each diagnoser generates performance data related to that diagnoser. For example, the CPUUsageDiagnoser generates a *.diagsession* file with CPU data in it, and the DatabaseDiagnoser generates a *.diagsession* file with data on database operations. Limitations correspond to the associated profiling tool. For example, the profiler's Database tool works on [ADO.NET](/dotnet/framework/data/adonet/ado-net-overview) or [Entity Framework Core](/ef/core/).
69
70
70
-
Add the diagnoser name as an attribute to the class that contains the benchmarks for which you want to generate data.
71
+
To attribute your code for diagnosers and benchmarks:
72
+
73
+
1. Add the diagnoser name as an attribute to the class that contains the benchmarks for which you want to generate data.
74
+
75
+
1. Add the `Benchmark` attribute to the methods that you want to test for performance.
71
76
72
77
For example, you can use the following code for the CPUUsageDiagnoser.
73
78
@@ -105,7 +110,7 @@ The benchmark functions must be added to a .NET console application. These funct
105
110
[Benchmark]
106
111
publicbyte[] Md5() =>md5.ComputeHash(data);
107
112
}
108
-
113
+
109
114
publicclassProgram
110
115
{
111
116
publicstaticvoidMain(string[] args)
@@ -115,7 +120,11 @@ The benchmark functions must be added to a .NET console application. These funct
Copy file name to clipboardExpand all lines: docs/python/debugging-mixed-mode-c-cpp-python-in-visual-studio.md
+11-2Lines changed: 11 additions & 2 deletions
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: Mixed-mode debugging for Python
3
3
description: Simultaneously debug C++ and Python in Visual Studio including stepping between environments, viewing values, and evaluating expressions.
4
-
ms.date: 04/18/2024
4
+
ms.date: 11/21/2025
5
5
ms.topic: how-to
6
6
author: cwebster-99
7
7
ms.author: cowebster
@@ -161,7 +161,16 @@ The **Call Stack** window shows both native and Python stack frames interleaved,
161
161
162
162
:::image type="content" source="media/mixed-mode-debugging-call-stack.png" alt-text="Screenshot of the combined call stack window with mixed-mode debugging in Visual Studio." border="false" lightbox="media/mixed-mode-debugging-call-stack.png":::
163
163
164
-
- To make transitions appear as **[External Code]** without specifying the direction of transition, set the **Tools** > **Options** > **Debugging** > **General** > **Enable Just My Code** option.
164
+
:::moniker range="visualstudio"
165
+
166
+
- To make transitions appear as **[External Code]** without specifying the direction of transition, use the **Tools** > **Options** pane. Expand the **All Settings** > **Debugging** > **General** section, select the **Enable Just My Code** checkbox.
167
+
168
+
:::moniker-end
169
+
:::moniker range="<=vs-2022"
170
+
171
+
- To make transitions appear as **[External Code]** without specifying the direction of transition, use the **Tools** > **Options** dialog. Expand the **Debugging** > **General** section, select the **Enable Just My Code** checkbox, and then select **OK**.
172
+
173
+
:::moniker-end
165
174
166
175
- To make any call frame active, double-click the frame. This action also opens the corresponding source code, if possible. If source code isn't available, the frame is still made active and local variables can be inspected.
Copy file name to clipboardExpand all lines: docs/python/debugging-symbols-for-mixed-mode-c-cpp-python.md
+44-7Lines changed: 44 additions & 7 deletions
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: Symbols for mixed-mode Python/C++ debugging
3
3
description: Explore how you can use Visual Studio to load symbols from program database (PDB) files to support complete mixed-mode debugging for C++ and Python.
4
-
ms.date: 04/18/2024
4
+
ms.date: 11/21/2025
5
5
ms.topic: how-to
6
6
author: cwebster-99
7
7
ms.author: cowebster
@@ -21,10 +21,21 @@ To provide a full debugging experience, the [mixed-mode Python debugger](debuggi
21
21
22
22
- In Visual Studio 2015 and earlier, or for other interpreters, you need to download symbols separately and then point Visual Studio to the files.
23
23
24
-
When Visual Studio detects missing required symbols, a dialog prompts you to take action. You typically see the dialog when you start a mixed-mode debugging session. The dialog includes the **Open symbol settings dialog** link, which opens the **Tools** > **Options** dialog to the **Debugging** > **Symbols** tab, along with a link to this documentation article.
24
+
When Visual Studio detects missing required symbols, a dialog prompts you to take action. You typically see the dialog when you start a mixed-mode debugging session. The dialog includes two links, one of which opens this documentation article.
25
25
26
26
:::image type="content" source="media/mixed-mode-debugging-symbols-required.png" alt-text="Screenshot that shows the prompt in Visual Studio to provide the missing required debugging symbols." lightbox="media/mixed-mode-debugging-symbols-required.png" border="false":::
27
27
28
+
:::moniker range="visualstudio"
29
+
30
+
The **Open symbol settings dialog** opens the **Tools** > **Options** pane to the **All Settings** > **Debugging** > **Symbols** section.
31
+
32
+
:::moniker-end
33
+
:::moniker range="<=vs-2022"
34
+
35
+
The **Open symbol settings dialog** opens the **Tools** > **Options** dialog to the **Debugging** > **Symbols** section.
36
+
37
+
:::moniker-end
38
+
28
39
## Prerequisites
29
40
30
41
- Visual Studio installed with support for Python workloads. For more information, see [Install Python support in Visual Studio](installing-python-support-in-visual-studio.md).
@@ -91,21 +102,47 @@ If you downloaded symbols separately, follow these steps to make Visual Studio a
91
102
> [!NOTE]
92
103
> If you installed symbols by using the Python 3.5 or later installer, Visual Studio finds the symbols automatically. You don't need to complete the steps in this section.
93
104
94
-
1. Select **Tools** > **Options**, and open the **Debugging** > **Symbols** tab.
105
+
:::moniker range="visualstudio"
106
+
107
+
1. Open the **Tools** > **Options** pane and expand the **All Settings** > **Debugging** > **Symbols** > **Search Locations** section.
108
+
109
+
1. On the toolbar for the **Symbol file (.pdb) locations** list, select **+ Add**.
110
+
111
+
1. In the **Add item** dialog, enter the folder path where you extracted the downloaded symbols, and then select **Save**.
112
+
113
+
Specify the location where the _python.pdb_ file is located, such as *c:\python34\Symbols*, as shown in the following image.
95
114
96
-
1. Select **Add** (plus symbol) on the toolbar.
115
+
:::image type="content" source="media/visualstudio/mixed-mode-debugging-symbols.png" border="false" alt-text="Screenshot that shows how to specify the location of the Python mixed mode debugger symbols.":::
97
116
98
-
1. Enter the folder path where you extracted the downloaded symbols. This location is where the `python.pdb` file is located, such as *c:\python34\Symbols*, as shown in the following image.
117
+
:::moniker-end
118
+
:::moniker range="<=vs-2022"
119
+
120
+
1. Open the **Tools** > **Options** dialog and expand the **Debugging** > **Symbols** section.
121
+
122
+
1. On the toolbar for the **Symbol file (.pdb) search locations** list, select **Add** (plus symbol).
123
+
124
+
1. In the list, enter the folder path where you extracted the downloaded symbols, and then select **OK**.
125
+
126
+
Specify the location where the _python.pdb_ file is located, such as *c:\python34\Symbols*, as shown in the following image.
99
127
100
128
:::image type="content" source="media/mixed-mode-debugging-symbols.png" alt-text="Screenshot that shows the mixed mode debugger symbols options on the Tools Options Debugging dialog." lightbox="media/mixed-mode-debugging-symbols.png" border="false":::
101
129
102
-
1. Select **OK**.
130
+
:::moniker-end
103
131
104
132
During a debugging session, Visual Studio might also prompt you for the location of a source file for the Python interpreter. If you downloaded source files, such as from [python.org/downloads/](https://www.python.org/downloads/), you can point Visual Studio to the downloaded files.
105
133
106
134
### Symbol caching options
107
135
108
-
The **Tools** > **Options**, **Debugging** > **Symbols** dialog also contains options to configure symbol caching. Visual Studio uses the symbol caching features to create a local cache of symbols obtained from an online source.
136
+
:::moniker range="visualstudio"
137
+
138
+
The **All Settings** > **Debugging** > **Symbols** section supports other options for configuring symbol caching in the **Search Locations** and **Search and Load** subsections. Visual Studio uses the symbol caching features to create a local cache of symbols obtained from an online source.
139
+
140
+
:::moniker-end
141
+
:::moniker range="<=vs-2022"
142
+
143
+
The **Debugging** > **Symbols** section supports other options for configuring symbol caching. Visual Studio uses the symbol caching features to create a local cache of symbols obtained from an online source.
144
+
145
+
:::moniker-end
109
146
110
147
These features aren't needed with the Python interpreter symbols because symbols are already present locally. For more information, see [Specify symbols and source files in the Visual Studio debugger](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md).
Copy file name to clipboardExpand all lines: docs/python/learn-django-in-visual-studio-step-01-project-and-solution.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Django in Visual Studio tutorial Step 1, Django basics
3
3
titleSuffix: ""
4
4
description: Overview and Step 1 of a core walkthrough of Django capabilities in Visual Studio, including prerequisites, Git, virtual environments, and creating a Django project.
5
-
ms.date: 04/18/2024
5
+
ms.date: 11/21/2025
6
6
ms.topic: tutorial
7
7
author: cwebster-99
8
8
ms.author: cowebster
@@ -213,9 +213,16 @@ For more information on source control as automation, see [The Source of Truth:
213
213
214
214
Follow these steps to prevent Visual Studio from auto-committing a new project:
215
215
216
-
::: moniker range=">=vs-2022"
216
+
::: moniker range="visualstudio"
217
+
218
+
1. Open the **Tools** > **Options** pane and expand the **All Settings** > **Source Control** > **Git Settings** section.
219
+
220
+
1. Clear the **Commit changes after merge by default** option.
221
+
222
+
::: moniker-end
223
+
::: moniker range="vs-2022"
217
224
218
-
1.Select **Tools** > **Options**> **Source Control** > **Git Global Settings**.
225
+
1.Open the **Tools** > **Options**dialog and expand the **Source Control** > **Git Global Settings** section.
219
226
220
227
1. Clear the **Commit changes after merge by default** option and select **OK**.
Copy file name to clipboardExpand all lines: docs/python/learn-flask-visual-studio-step-01-project-solution.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Flask in Visual Studio tutorial Step 1, Flask basics
3
3
titleSuffix: ""
4
4
description: Overview and Step 1 of a core walkthrough of Flask capabilities in Visual Studio, including prerequisites, Git, virtual environments, and creating a new Flask project and web project.
5
-
ms.date: 04/18/2024
5
+
ms.date: 11/21/2025
6
6
ms.topic: tutorial
7
7
author: cwebster-99
8
8
ms.author: cowebster
@@ -202,9 +202,16 @@ For more information on source control as automation, see [The Source of Truth:
202
202
203
203
Follow these steps to prevent Visual Studio from auto-committing a new project:
204
204
205
-
::: moniker range=">=vs-2022"
205
+
::: moniker range="visualstudio"
206
+
207
+
1. Open the **Tools** > **Options** pane and expand the **All Settings** > **Source Control** > **Git Settings** section.
208
+
209
+
1. Clear the **Commit changes after merge by default** option.
210
+
211
+
::: moniker-end
212
+
::: moniker range="vs-2022"
206
213
207
-
1.Select **Tools** > **Options**> **Source Control** > **Git Global Settings**.
214
+
1.Open the **Tools** > **Options**dialog and expand the **Source Control** > **Git Global Settings** section.
208
215
209
216
1. Clear the **Commit changes after merge by default** option and select **OK**.
0 commit comments