Skip to content

Commit b94be53

Browse files
Merge pull request #14696 from MicrosoftDocs/main
Auto Publish – main to live - 2025-11-25 23:00 UTC
2 parents 12299aa + 92f6ec3 commit b94be53

20 files changed

Lines changed: 259 additions & 106 deletions
46.6 KB
Loading

docs/debugger/remote-debugging-azure-app-service.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Remote Debug ASP.NET Core on Azure App Service"
33
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
55
ms.topic: article
66
author: "mikejo5000"
77
ms.author: "mikejo"
@@ -20,8 +20,6 @@ This article describes how to attach the Visual Studio debugger to an ASP.NET Co
2020

2121
- You must first deploy an ASP.NET Core app to Azure App Service (Windows) from Visual Studio, and the app must be running.
2222

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-
2523
- Your publish profile in Visual Studio must be set to Debug instead of Release before publishing.
2624

2725
## Enable remote debugging
@@ -51,11 +49,17 @@ Your app service instance now supports remote debugging through Visual Studio.
5149
> [!NOTE]
5250
> 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.
5351
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**.
5553

5654
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.
5755

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"
5861
:::image type="content" source="../debugger/media/vs-2022/visual-studio-remote-debug-settings.png" alt-text="A screenshot of the Visual Studio debugging settings.":::
62+
::: moniker-end
5963

6064
## Attach the debugger to the App Service
6165

docs/profiling/profiling-with-benchmark-dotnet.md

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Analyze BenchmarkDotNet data in Visual Studio"
33
description: Learn how to profile console apps using BenchmarkDotNet.
4-
ms.date: 11/10/2025
4+
ms.date: 11/24/2025
55
ms.topic: how-to
66
dev_langs:
77
- "CSharp"
@@ -17,19 +17,9 @@ monikerRange: '>= vs-2022'
1717

1818
# Analyze BenchmarkDotNet data in Visual Studio
1919

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

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

3424
## Prerequisites
3525

@@ -44,30 +34,45 @@ Each diagnoser generates performance data related to that diagnoser. For example
4434
If you use the Benchmark project template, these NuGet packages are present when you create the project.
4535
::: moniker-end
4636

47-
## Create your project
37+
## Set up your project
4838

4939
::: 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.
5141

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:
5343

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

5649
![Screenshot of BenchmarkDotNet template in Visual Studio.](../profiling/media/visualstudio/benchmark-dotnet-template.png)
5750
::: moniker-end
5851
::: moniker range="vs-2022"
59-
Create a console project.
52+
Create a console project or use an existing console project.
6053

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.
6255
::: moniker-end
6356

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:
6562

66-
1. Set your build to a Release build instead of a Debug build.
63+
- CPUUsageDiagnoser
64+
- DatabaseDiagnoser
65+
- DotNetCountersDiagnoser
66+
- EventsDiagnoser
67+
- FileIODiagnoser
6768

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/).
6970

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

7277
For example, you can use the following code for the CPUUsageDiagnoser.
7378

@@ -105,7 +110,7 @@ The benchmark functions must be added to a .NET console application. These funct
105110
[Benchmark]
106111
public byte[] Md5() => md5.ComputeHash(data);
107112
}
108-
113+
109114
public class Program
110115
{
111116
public static void Main(string[] args)
@@ -115,7 +120,11 @@ The benchmark functions must be added to a .NET console application. These funct
115120
}
116121
}
117122
```
118-
123+
124+
## Collect and view Benchmark.NET data
125+
126+
1. Set your build to a **Release** build instead of a Debug build.
127+
119128
1. Run the application to generate the *.diagsession* file.
120129

121130
Check the console output to get the location of the file. For example:
@@ -127,8 +136,6 @@ The benchmark functions must be added to a .NET console application. These funct
127136
Stopped
128137
Exported diagsession file: *.diagsession
129138
```
130-
131-
## View BenchmarkDotNet data
132139

133140
1. In Visual Studio, select **File > Open > File** and navigate to the location of the *.diagsession* file, and then select and open the file.
134141

docs/python/debugging-mixed-mode-c-cpp-python-in-visual-studio.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Mixed-mode debugging for Python
33
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
55
ms.topic: how-to
66
author: cwebster-99
77
ms.author: cowebster
@@ -161,7 +161,16 @@ The **Call Stack** window shows both native and Python stack frames interleaved,
161161

162162
:::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":::
163163

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
165174

166175
- 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.
167176

docs/python/debugging-symbols-for-mixed-mode-c-cpp-python.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Symbols for mixed-mode Python/C++ debugging
33
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
55
ms.topic: how-to
66
author: cwebster-99
77
ms.author: cowebster
@@ -21,10 +21,21 @@ To provide a full debugging experience, the [mixed-mode Python debugger](debuggi
2121

2222
- In Visual Studio 2015 and earlier, or for other interpreters, you need to download symbols separately and then point Visual Studio to the files.
2323

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

2626
:::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":::
2727

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+
2839
## Prerequisites
2940

3041
- 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
91102
> [!NOTE]
92103
> 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.
93104
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.
95114

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.":::
97116

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

100128
:::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":::
101129

102-
1. Select **OK**.
130+
:::moniker-end
103131

104132
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.
105133

106134
### Symbol caching options
107135

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
109146

110147
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).
111148

docs/python/learn-django-in-visual-studio-step-01-project-and-solution.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Django in Visual Studio tutorial Step 1, Django basics
33
titleSuffix: ""
44
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
66
ms.topic: tutorial
77
author: cwebster-99
88
ms.author: cowebster
@@ -213,9 +213,16 @@ For more information on source control as automation, see [The Source of Truth:
213213

214214
Follow these steps to prevent Visual Studio from auto-committing a new project:
215215

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"
217224

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

220227
1. Clear the **Commit changes after merge by default** option and select **OK**.
221228

docs/python/learn-flask-visual-studio-step-01-project-solution.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Flask in Visual Studio tutorial Step 1, Flask basics
33
titleSuffix: ""
44
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
66
ms.topic: tutorial
77
author: cwebster-99
88
ms.author: cowebster
@@ -202,9 +202,16 @@ For more information on source control as automation, see [The Source of Truth:
202202

203203
Follow these steps to prevent Visual Studio from auto-committing a new project:
204204

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"
206213

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

209216
1. Clear the **Commit changes after merge by default** option and select **OK**.
210217

6.62 KB
Loading
220 KB
Loading
129 KB
Loading

0 commit comments

Comments
 (0)