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/debug-with-copilot.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ In addition, Copilot provides more precise help for a few targeted scenarios inc
27
27
- Exceptions
28
28
- Auto Insights for CPU Usage
29
29
30
-
To get AI assistance While you're debugging in these scenarios, look for the **Ask Copilot** button. In these scenarios, Copilot already knows the context for your questions. For example, it knows the current call stack, the code line you are asking about, and the name of the exception (if one occurred), so you don't need to provide context yourself in chat.
30
+
To get AI assistance while you're debugging in these scenarios, look for the **Ask Copilot** button. In these scenarios, Copilot already knows the context for your questions. For example, it knows the current call stack, the code line you are asking about, and the name of the exception (if one occurred), so you don't need to provide context yourself in chat.
31
31
32
32
For more information on the GitHub Copilot extension in Visual Studio, see [About the GitHub Copilot extension for Visual Studio](../ide/visual-studio-github-copilot-extension.md).
Copy file name to clipboardExpand all lines: docs/debugger/debugger-feature-tour.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -237,6 +237,11 @@ The Exception Helper is a great feature that can help you debug errors. You can
237
237
238
238
Expand the **Exception Settings** node to see more options on how to handle this exception type, but you don't need to change anything for this tour!
239
239
240
+
::: moniker range=">= vs-2022"
241
+
> [!TIP]
242
+
> If you have [Copilot](../ide/visual-studio-github-copilot-extension.md), you can get AI assistance while you're debugging exceptions. Just look for the **Ask Copilot** button. For more information, see [Debug with Copilot](../debugger/debug-with-copilot.md).
243
+
::: moniker-end
244
+
240
245
## Configure debugging
241
246
242
247
You can configure your project to build as a [Debug or Release configuration](../debugger/how-to-set-debug-and-release-configurations.md), configure project properties for debugging, or configure [general settings](../debugger/how-to-specify-debugger-settings.md) for debugging. In addition, you can configure the debugger to display custom information using features such as [DebuggerDisplay](using-the-debuggerdisplay-attribute.md) attribute or, for C/C++, the [NatVis framework](create-custom-views-of-native-objects.md).
Copy file name to clipboardExpand all lines: docs/debugger/exception-helper.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,11 @@ Starting in Visual Studio 2022 version 17.3, you can view exception stack frames
66
66
67
67

68
68
::: moniker-end
69
+
::: moniker range=">= vs-2022"
70
+
## Get AI asistance
71
+
72
+
If you have [Copilot](../ide/visual-studio-github-copilot-extension.md), you can get AI assistance while you're debugging exceptions. Just look for the **Ask Copilot** button. In these scenarios, Copilot already knows the context for your questions, so you don't need to provide context yourself in chat. For more information, see [Debug with Copilot](../debugger/debug-with-copilot.md).
Copy file name to clipboardExpand all lines: docs/debugger/write-better-code-with-visual-studio.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -301,6 +301,11 @@ Here are a couple of important tips for exception handling:
301
301
302
302
Forthesampleapp, fixthe `SerializationException` inthe `GetJsonData` methodbychanging `4o` to `40`.
303
303
304
+
:::monikerrange=">= vs-2022"
305
+
> [!TIP]
306
+
>Ifyouhave [Copilot](../ide/visual-studio-github-copilot-extension.md), youcangetAIassistancewhileyou're debugging exceptions. Just look for the **Ask Copilot**  button. For more information, see [Debug with Copilot](../debugger/debug-with-copilot.md).
Copy file name to clipboardExpand all lines: docs/msbuild/writing-multi-processor-aware-loggers.md
+23-7Lines changed: 23 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Writing Multi-Processor-Aware Loggers"
3
3
description: Learn how MSBuild provides a multi-processor-aware logger and logging model, and lets you create custom "forwarding loggers."
4
-
ms.date: "11/04/2016"
4
+
ms.date: 04/03/2024
5
5
ms.topic: "conceptual"
6
6
helpviewer_keywords:
7
7
- "msbuild, multi-proc aware loggers"
@@ -14,11 +14,15 @@ ms.subservice: msbuild
14
14
---
15
15
# Write multi-processor-aware loggers
16
16
17
-
The ability of MSBuild to take advantage of multiple processors can decrease project building time, but it also adds complexity to build event logging. In a single-processor environment, events, messages, warnings, and errors arrive at the logger in a predictable, sequential manner. However, in a multi-processor environment, events from different sources can arrive at the same time or out of sequence. To provide for this, MSBuild provides a multi-processor-aware logger and a new logging model, and lets you create custom "forwarding loggers."
17
+
The ability of MSBuild to take advantage of multiple processors can decrease project building time, but it also adds complexity to build event logging. In a single-processor environment, events, messages, warnings, and errors arrive at the logger in a predictable, sequential manner. However, in a multi-processor environment, events from different sources can arrive at the same time or out of sequence.
18
+
19
+
Generating a binary log (`-binlog` or `-bl` switch) and viewing it with the [structured log viewer](https://msbuildlog.com/) largely solves this issue. With MSBuild version 17.8 or later, you can also try the terminal logger (`-tl` switch) for more user-friendly logging output in real time at the console.
20
+
21
+
For a more general solution, MSBuild provides a multi-processor-aware logger and a logging model that you can use to create custom "forwarding loggers."
18
22
19
23
## Multi-processor logging challenges
20
24
21
-
When you build one or more projects on a multi-processor or multi-core system, MSBuild build events for all the projects are generated at the same time. An avalanche of event messages may arrive at the logger at the same time or out of sequence. Because an MSBuild 2.0 logger is not designed to handle this situation, it can overwhelm the logger and cause increased build times, incorrect logger output, or even a broken build. To address these issues, the logger (starting in MSBuild 3.5) can process out-of-sequence events and correlate events and their sources.
25
+
When you build one or more projects on a multi-processor or multi-core system, MSBuild build events for all the projects are generated at the same time. An avalanche of event messages may arrive at the logger at the same time or out of sequence. Because an MSBuild 2.0 logger is not designed to handle this situation, it can overwhelm the logger and cause increased build times, incorrect logger output, or even a broken build. To address these issues, the logger can process out-of-sequence events and correlate events and their sources.
22
26
23
27
You can improve logging efficiency even more by creating a custom forwarding logger. A custom forwarding logger acts as a filter by letting you choose, before you build, only the events you want to monitor. When you use a custom forwarding logger, unwanted events cannot overwhelm the logger, clutter your logs, or slow build times.
24
28
@@ -65,13 +69,25 @@ public interface INodeLogger: ILogger
65
69
66
70
- Write your own custom forwarding logger.
67
71
68
-
You can modify ConfigurableForwardingLogger to suit your requirements. To do this, call the logger on the command line by using *MSBuild.exe*, and list the build events that you want the logger to forward to the central node.
72
+
You can modify `ConfigurableForwardingLogger` to suit your requirements. To do this, call the logger on the command line by using *MSBuild.exe*, and list the build events that you want the logger to forward to the central node.
73
+
74
+
As an alternative, you can create a custom forwarding logger. By creating a custom forwarding logger, you can fine-tune the behavior of the logger. However, creating a custom forwarding logger is more complex than just customizing the ConfigurableForwardingLogger. You can create a forwarding logger by implementing the <xref:Microsoft.Build.Framework.IForwardingLogger> interface, which derives from <xref:Microsoft.Build.Framework.ILogger>. The interface is defined as:
To forward an event that your logger cares about, call the <xref:Microsoft.Build.Framework.IEventRedirector.ForwardEvent%2A> method of the <xref:Microsoft.Build.Framework.IEventRedirector> interface in your forwarding logger. Pass the appropriate <xref:Microsoft.Build.Framework.BuildEventArgs>, or a derivative, as the parameter. The events will then be forwarded to the central logger and can be acted on there.
69
85
70
-
As an alternative, you can create a custom forwarding logger. By creating a custom forwarding logger, you can fine-tune the behavior of the logger. However, creating a custom forwarding logger is more complex than just customizing the ConfigurableForwardingLogger. For more information, see [Creating forwarding loggers](../msbuild/creating-forwarding-loggers.md).
86
+
For more information, see [Creating forwarding loggers](../msbuild/creating-forwarding-loggers.md).
71
87
72
88
## Using the ConfigurableForwardingLogger for simple distributed logging
73
89
74
-
To attach either a ConfigurableForwardingLogger or a custom forwarding logger, use the `-distributedlogger` switch (`-dl` for short) in an *MSBuild.exe* command-line build. The format for specifying the names of the logger types and classes is the same as that for the `-logger` switch, except that a distributed logger always has two logging classes instead of one, the forwarding logger and the central logger. The following is an example of how to attach a custom forwarding logger named XMLForwardingLogger.
90
+
To attach either a `ConfigurableForwardingLogger` or a custom forwarding logger, use the `-distributedlogger` switch (`-dl` for short) in an *MSBuild.exe* command-line build. The format for specifying the names of the logger types and classes is the same as that for the `-logger` switch, except that a distributed logger always has two logging classes instead of one, the forwarding logger and the central logger. The following is an example of how to attach a custom forwarding logger named XMLForwardingLogger.
> An asterisk (*) must separate the two logger names in the `-dl` switch.
82
98
83
-
Using the ConfigurableForwardingLogger is like using any other logger (as outlined in [Obtaining build logs](../msbuild/obtaining-build-logs-with-msbuild.md)), except that you attach the ConfigurableForwardingLogger logger instead of the typical MSBuild logger and you specify as parameters the events that you want the ConfigurableForwardingLogger to pass on to the central node.
99
+
Using the `ConfigurableForwardingLogger` is like using any other logger (as outlined in [Obtaining build logs](../msbuild/obtaining-build-logs-with-msbuild.md)), except that you attach the ConfigurableForwardingLogger logger instead of the typical MSBuild logger and you specify as parameters the events that you want the ConfigurableForwardingLogger to pass on to the central node.
84
100
85
101
For example, if you want to be notified only when a build starts and ends, and when an error occurs, you would pass `BUILDSTARTEDEVENT`, `BUILDFINISHEDEVENT`, and `ERROREVENT` as parameters. Multiple parameters can be passed by separating them with semi-colons. The following is an example of how to use the ConfigurableForwardingLogger to forward only the `BUILDSTARTEDEVENT`, `BUILDFINISHEDEVENT`, and `ERROREVENT` events.
Copy file name to clipboardExpand all lines: docs/profiling/cpu-insights.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ monikerRange: '>= vs-2022'
11
11
---
12
12
# Diagnose high latency with CPU Insights
13
13
14
-
**CPU Insights** is a sub-feature of the CPU Usage tool that shows common potential latency issues like concatenating strings inefficiently.
14
+
CPU insights is a sub-feature of the CPU Usage tool that shows common potential latency issues like concatenating strings inefficiently.
15
15
16
16
## View top insights
17
17
@@ -29,6 +29,12 @@ On the summary page under **Top Functions**, you can find the top functions call
29
29
30
30

31
31
32
+
::: moniker range=">= vs-2022"
33
+
## Get AI asistance
34
+
35
+
If you have [Copilot](../ide/visual-studio-github-copilot-extension.md), you can get AI assistance while you're looking at CPU insights. Just look for the **Ask Copilot** button. In these scenarios, Copilot already knows the context for your questions, so you don't need to provide context yourself in chat. For more information, see [Debug with Copilot](../debugger/debug-with-copilot.md).
36
+
::: moniker-end
37
+
32
38
## Related content
33
39
34
40
-[Analyze CPU usage in the Performance Profiler](../profiling/cpu-usage.md)
0 commit comments