Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5752500
add new release
Aug 2, 2023
3aa2b53
Updates for SEO for custom visualizers
Mikejo5000 Aug 8, 2023
65c1546
shorten the intro, add links
Mikejo5000 Aug 8, 2023
c20598a
more updates
Mikejo5000 Aug 8, 2023
9d99dc0
updates
Mikejo5000 Aug 8, 2023
e3a0cb3
minor edits
Mikejo5000 Aug 8, 2023
c777452
link updates
Mikejo5000 Aug 8, 2023
653c248
Add C&L comment to includes file: activation-subscriptions.md
evanwindom Aug 8, 2023
5a7e1fb
tweak
Mikejo5000 Aug 8, 2023
3a8cf9d
Add C&L comment to includes file: activate-with-product-keys.md
evanwindom Aug 8, 2023
aa12c55
Add C&L comment to includes file: available-benefits.md
evanwindom Aug 8, 2023
7d01407
link updates
Mikejo5000 Aug 8, 2023
cc2275c
minor edits
Mikejo5000 Aug 8, 2023
3864515
Add C&L comment to includes files azure-dev-test-discount.md & downlo…
evanwindom Aug 8, 2023
6fc801e
update the Update date + add blog post link
TerryGLee Aug 8, 2023
bea280c
Merge pull request #11539 from TerryGLee/tglee-whatsnew11
prmerger-automator[bot] Aug 8, 2023
15a2ffd
updated per Acrolinx suggestions
Aug 8, 2023
4f03977
acrolinx
v-dirichards Aug 8, 2023
063e4f9
Merge pull request #11528 from Mikejo5000/mikejo-br20
v-dirichards Aug 8, 2023
792851d
add Copy & Trim Indentation info
TerryGLee Aug 8, 2023
7451d27
add cross-links
TerryGLee Aug 8, 2023
a3c1d18
Merge pull request #11538 from rigel512/evanwindom-includes-comments
American-Dipper Aug 8, 2023
077f42d
fix relnotes links
TerryGLee Aug 8, 2023
b095619
apply Acrolinx suggestions
TerryGLee Aug 8, 2023
fe01e2e
Update version monikers for Vue articles
Mikejo5000 Aug 8, 2023
aa91870
test
Mikejo5000 Aug 8, 2023
ed5314c
revise links per Build suggestion
TerryGLee Aug 8, 2023
399d4cf
TOC updates
Mikejo5000 Aug 8, 2023
9d6ecfb
TOC edits
Mikejo5000 Aug 8, 2023
03138cf
Merge pull request #11542 from TerryGLee/tglee-ide016
American-Dipper Aug 8, 2023
0ed5acd
Merge pull request #11540 from John-Hart/add_vstor_release
prmerger-automator[bot] Aug 8, 2023
50cef2a
Merge pull request #11534 from MicrosoftDocs/repo_sync_working_branch
PhilKang0704 Aug 8, 2023
6bf856d
Update create-application-with-vuejs.md
AnnaMHuff Aug 8, 2023
7401dab
Merge pull request #11543 from Mikejo5000/mikejo-br21
AnnaMHuff Aug 8, 2023
06fe3ba
add cross-links to File Comparison content
TerryGLee Aug 8, 2023
8680c2c
remove superfluous heading in one xlink
TerryGLee Aug 8, 2023
353f460
Merge pull request #11544 from TerryGLee/tglee-ide016
prmerger-automator[bot] Aug 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/debugger/create-custom-views-of-managed-objects.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Create custom views of managed objects | Microsoft Docs"
title: "Create custom views of .NET objects | Microsoft Docs"
description: Visual Studio debugger displays data in its variable windows. Learn to customize how data types—including custom types—are displayed.
ms.date: "01/08/2019"
ms.date: "08/08/2023"
ms.topic: "conceptual"
f1_keywords:
- "vs.debug.data.elements"
Expand All @@ -26,23 +26,23 @@ ms.technology: vs-ide-debug
ms.workload:
- "dotnet"
---
# Create custom views of managed objects (C#, Visual Basic, F#, C++/CLI)
# Create custom views of .NET objects (C#, Visual Basic, F#, C++/CLI)

[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
You can customize the way Visual Studio displays data types in debugger variable windows.

## Attributes

In C#, Visual Basic, F#, and C++ (C++/CLI code only), you can add expansions for custom data using <xref:System.Diagnostics.DebuggerTypeProxyAttribute>, <xref:System.Diagnostics.DebuggerDisplayAttribute>, and <xref:System.Diagnostics.DebuggerBrowsableAttribute>.
In C#, Visual Basic, F#, and C++ (C++/CLI code only), you can add expansions for custom data using <xref:System.Diagnostics.DebuggerDisplayAttribute>, <xref:System.Diagnostics.DebuggerTypeProxyAttribute>, and <xref:System.Diagnostics.DebuggerBrowsableAttribute>.

In .NET Framework 2.0 code, Visual Basic does not support the DebuggerBrowsable attribute. This limitation is removed in more recent versions of .NET.

## Visualizers

You can write a visualizer to display any managed data type. For more information, see [How to: Write a Visualizer](create-custom-visualizers-of-data.md).
You can write a visualizer to display any .NET data type. For more information, see [Custom visualizers](create-custom-visualizers-of-data.md).

> [!NOTE]
> For C++ code, you can add custom data type expansions using the Natvis framework, as described in [Create custom views of C++ objects in the debugger](create-custom-views-of-native-objects.md).
> To create a visualizer for C/C++ objects, see [UIVisualizer element](../debugger/create-custom-views-of-native-objects.md#BKMK_UIVisualizer) within the [Natvis](../debugger/create-custom-views-of-native-objects.md) documentation. Also, see the [C/C++ custom visualizer sample](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/master/CppCustomVisualizer) or the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample.

## See also

Expand Down
43 changes: 22 additions & 21 deletions docs/debugger/create-custom-visualizers-of-data.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Create custom data visualizers | Microsoft Docs"
title: "Custom data visualizers for .NET debugging | Microsoft Docs"
description: Visual Studio debugger visualizers are components that display data. Learn about the six standard visualizers, and about how you can write or download others.
ms.date: "07/29/2021"
ms.date: "08/08/2023"
ms.topic: "conceptual"
f1_keywords:
- "vs.debug.visualizer.troubleshoot"
Expand All @@ -22,28 +22,31 @@ ms.technology: vs-ide-debug
ms.workload:
- "multiple"
---
# Create custom data visualizers
# Custom data visualizers for the Visual Studio debugger (.NET)

[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]

A *visualizer* is part of the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger user interface that displays a variable or object in a manner appropriate to its data type. For example, an HTML visualizer interprets an HTML string and displays the result as it would appear in a browser window. A bitmap visualizer interprets a bitmap structure and displays the graphic it represents. Some visualizers let you modify as well as view the data.
A *visualizer* is part of the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger user interface that displays a variable or object in a manner appropriate to its data type. For example, a [bitmap visualizer](/previous-versions/visualstudio/visual-studio-2015/debugger/image-watch/image-watch) interprets a bitmap structure and displays the graphic it represents. Some visualizers let you modify as well as view the data. In the debugger, a visualizer is represented by a magnifying glass icon ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon"). You can select the icon in a **DataTip**, debugger **Watch** window, or **QuickWatch** dialog box, and then select the appropriate visualizer for the corresponding object.

The [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger includes six standard visualizers. The text, HTML, XML, and JSON visualizers work on string objects. The WPF Tree visualizer displays the properties of a WPF object visual tree. The dataset visualizer works for DataSet, DataView, and DataTable objects.
In addition to the [standard built-in visualizers](../debugger/view-strings-visualizer.md), more visualizers may be available for download from Microsoft, third parties, and the community. You can also write your own visualizers and install them in the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger.

More visualizers may be available for download from Microsoft, third parties, and the community. You can also write your own visualizers and install them in the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger.
This article provides a high-level overview of visualizer creation. For detailed instructions, see the following articles instead:

In the debugger, a visualizer is represented by a magnifying glass icon ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon"). You can select the icon in a **DataTip**, debugger **Watch** window, or **QuickWatch** dialog box, and then select the appropriate visualizer for the corresponding object.
- [Walkthrough: Write a visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md)
- [Walkthrough: Write a visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md)
- [Install a visualizer](../debugger/how-to-install-a-visualizer.md)
- (C/C++) [C/C++ custom visualizer sample](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/master/CppCustomVisualizer) or the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample.

## Write custom visualizers
> [!NOTE]
> Custom visualizers are not supported for UWP and Windows 8.x apps.

> [!NOTE]
> To create a custom visualizer for native code, see the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample. Custom visualizers are not supported for UWP and Windows 8.x apps.
## Overview

You can write a custom visualizer for an object of any managed class except for <xref:System.Object> and <xref:System.Array>.

The architecture of a debugger visualizer has two parts:

- The *debugger side* runs within the Visual Studio debugger, and creates and displays the visualizer user interface.
- The *debugger side* runs within the Visual Studio debugger, and creates and displays the visualizer user interface.

Because Visual Studio executes on the .NET Framework Runtime, this component has to be written for .NET Framework. For this reason, it is not possible to write it for .NET Core.

Expand All @@ -61,9 +64,7 @@ You can write a visualizer for a generic type only if the type is an open type.

Custom visualizers may have security considerations. See [Visualizer security considerations](../debugger/visualizer-security-considerations.md).

The following steps give a high-level overview of visualizer creation. For detailed instructions, see [Walkthrough: Write a visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) or [Walkthrough: Write a visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md).

### To create the debugger side
## Create the debugger side user interface

To create the visualizer user interface on the debugger side, you create a class that inherits from <xref:Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer>, and override the <xref:Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer.Show%2A?displayProperty=fullName> method to display the interface. You can use <xref:Microsoft.VisualStudio.DebuggerVisualizers.IDialogVisualizerService> to display Windows forms, dialogs, and controls in your visualizer.

Expand All @@ -75,7 +76,7 @@ To create the visualizer user interface on the debugger side, you create a class

1. Apply <xref:System.Diagnostics.DebuggerVisualizerAttribute>, giving it the visualizer to display (<xref:Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer>).

#### Special debugger side considerations for .NET 5.0+
### Special debugger side considerations for .NET 5.0+

Custom Visualizers transfer data between the *debuggee* and *debugger* sides through binary serialization using
the <xref:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter> class by default. However, that kind of
Expand Down Expand Up @@ -104,15 +105,15 @@ section to learn what other changes are required on the *debuggee-side* when usi
> [!NOTE]
> If you would like more information on the issue, see the [BinaryFormatter security guide](/dotnet/standard/serialization/binaryformatter-security-guide).

### To create the visualizer object source for the debuggee side
## Create the visualizer object source for the debuggee side

In the debugger side code, edit the <xref:System.Diagnostics.DebuggerVisualizerAttribute>, giving it the type to visualize (the debuggee-side object source) (<xref:Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource>). The `Target` property sets the object source. If you omit the object source, the visualizer will use a default object source.

The debuggee side code contains the object source that gets visualized. The data object can override methods of <xref:Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource>. A debuggee side DLL is necessary if you want to create a standalone visualizer.

In the debuggee-side code:

- To let the visualizer edit data objects, the object source must inherit from from <xref:Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource> and override the `TransferData` or `CreateReplacementObject` methods.
- To let the visualizer edit data objects, the object source must inherit from <xref:Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource> and override the `TransferData` or `CreateReplacementObject` methods.

- If you need to support multi-targeting in your visualizer, you can use the following Target Framework Monikers (TFMs) in the debuggee-side project file.

Expand All @@ -122,7 +123,7 @@ In the debuggee-side code:

These are the only supported TFMs.

#### Special debuggee side considerations for .NET 5.0+
### Special debuggee side considerations for .NET 5.0+

> [!IMPORTANT]
> Additional steps might be needed for a visualizer to work starting in .NET 5.0 due to security concerns regarding the underlying binary
Expand All @@ -140,7 +141,7 @@ it returns helps to determine the object's serialization format (binary or JSON)

- [Walkthrough: Write a visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md)
- [Walkthrough: Write a visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md)
- [How to: Install a visualizer](../debugger/how-to-install-a-visualizer.md)
- [How to: Test and debug a visualizer](../debugger/how-to-test-and-debug-a-visualizer.md)
- [Install a visualizer](../debugger/how-to-install-a-visualizer.md)
- [Test and debug a visualizer](../debugger/how-to-test-and-debug-a-visualizer.md)
- [Visualizer API reference](../debugger/visualizer-api-reference.md)
- [View data in the debugger](../debugger/viewing-data-in-the-debugger.md)
2 changes: 1 addition & 1 deletion docs/debugger/dataset-visualizer-dialog-box.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ The DataSet Visualizer allows you to view the contents of a DataSet, DataTable,
## See also

- [Debugger Security](../debugger/debugger-security.md)
- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md)
- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md)
- [Debugger Windows](../debugger/debugger-windows.md)
- [View data values in Data Tips](../debugger/view-data-values-in-data-tips-in-the-code-editor.md)
2 changes: 1 addition & 1 deletion docs/debugger/how-to-test-and-debug-a-visualizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ An easier way to debug a visualizer is to run the visualizer from a test driver.
## See also
- [Walkthrough: Writing a Visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md)
- [How to: Install a Visualizer](../debugger/how-to-install-a-visualizer.md)
- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md)
- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md)
2 changes: 1 addition & 1 deletion docs/debugger/how-to-use-the-wpf-tree-visualizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ You can use the WPF Tree visualizer to explore the visual tree of a WPF object,
- Click the **Close** icon in the upper-right corner of the dialog box.

## See also
- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md)
- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md)
- [Trees in WPF](/dotnet/framework/wpf/advanced/trees-in-wpf)
- [Dependency Properties Overview](/dotnet/framework/wpf/advanced/dependency-properties-overview)
4 changes: 2 additions & 2 deletions docs/debugger/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
href: view-data-values-in-data-tips-in-the-code-editor.md
- name: View string values in a visualizer
href: view-strings-visualizer.md
- name: View .NET collections with the IEnumerable visualizer
- name: View .NET collections in a tabular visualizer
href: view-data-in-tabular-visualizer.md
- name: Disassembly code
items:
Expand Down Expand Up @@ -188,7 +188,7 @@
href: using-debuggertypeproxy-attribute.md
- name: Custom visualizers
items:
- name: Create custom visualizers of data
- name: Create custom visualizers of data (.NET)
href: create-custom-visualizers-of-data.md
- name: Visualizer architecture
href: visualizer-architecture.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ You can also toggle property names and filter out non-pinned properties when vie

## Visualize complex data types

A magnifying glass icon next to a variable or element in a data tip means that one or more [visualizers](../debugger/create-custom-visualizers-of-data.md), such as the [Text Visualizer](../debugger/string-visualizer-dialog-box.md), are available for the variable. Visualizers display information in a more meaningful, sometimes graphical, manner.
A magnifying glass icon next to a variable or element in a data tip means that one or more visualizers, such as the [Text Visualizer](../debugger/string-visualizer-dialog-box.md), are available for the variable. Visualizers display information in a more meaningful, sometimes graphical, manner.

To view the element using the default visualizer for the data type, select the magnifying glass icon ![Visualizer icon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon"). Select the arrow next to the magnifying glass icon to select from a list of visualizers for the data type.

Expand Down Expand Up @@ -148,4 +148,4 @@ You can export data tips to an XML file, which you can share or edit using a tex
- [First look at debugging](../debugger/debugger-feature-tour.md)
- [Viewing Data in the Debugger](../debugger/viewing-data-in-the-debugger.md)
- [Watch and QuickWatch Windows](../debugger/watch-and-quickwatch-windows.md)
- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md)
- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md)
9 changes: 6 additions & 3 deletions docs/debugger/viewing-data-in-the-debugger.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Create custom views of data in the debugger | Microsoft Docs"
description: Learn the various ways to inspect and modify program state in Visual Studio debugger. These include the Autos and Watch windows, DataTips, and Visualizers.
ms.date: "01/09/2019"
ms.date: "08/08/2023"
ms.topic: "conceptual"
dev_langs:
- "CSharp"
Expand All @@ -28,11 +28,14 @@ The [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] debugger provides

## Create custom views of data in variable windows and DataTips

Many of the [debugger windows](../debugger/debugger-windows.md), such as the **Autos** and **Watch** windows, allow you to inspect variables. You can customize how C++ types, managed objects, and your own types are shown in the debugger variable windows and in [DataTips](../debugger/view-data-values-in-data-tips-in-the-code-editor.md). For more information, see [Create custom views of C++ objects](../debugger/create-custom-views-of-native-objects.md) and [Create custom views of managed objects](../debugger/create-custom-views-of-managed-objects.md).
Many of the [debugger windows](../debugger/debugger-windows.md), such as the **Autos** and **Watch** windows, allow you to inspect variables. You can customize how C++ types, managed objects, and your own types are shown in the debugger variable windows and in [DataTips](../debugger/view-data-values-in-data-tips-in-the-code-editor.md). For more information, see [Create custom views of C++ objects](../debugger/create-custom-views-of-native-objects.md) and [Create custom views of .NET objects](../debugger/create-custom-views-of-managed-objects.md).

## Create custom visualizers

Visualizers enable you to view the contents of an object or variable in a meaningful way. In the Visual Studio debugger, a visualizer refers to the different windows that you can open using the magnifying glass ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon") icon. For example, the HTML visualizer shows how an HTML string would be interpreted and displayed in a browser. You can access visualizers from DataTips, the **Watch** window, the **Autos** window, and the **Locals** window. The **QuickWatch** dialog box also provides a visualizer. For more information, see [Create custom visualizers](../debugger/create-custom-visualizers-of-data.md).
Visualizers enable you to view the contents of an object or variable in a meaningful way. In the Visual Studio debugger, a visualizer refers to the different windows that you can open using the magnifying glass ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon") icon. For example, the HTML visualizer shows how an HTML string would be interpreted and displayed in a browser. You can access visualizers from DataTips, the **Watch** window, the **Autos** window, and the **Locals** window. The **QuickWatch** dialog box also provides a visualizer. For more information:

- To create a visualizer for .NET objects, see [Custom visualizers](../debugger/create-custom-visualizers-of-data.md).
- To create a visualizer for C/C++ objects, see [UIVisualizer element](../debugger/create-custom-views-of-native-objects.md#BKMK_UIVisualizer) within the [Natvis](../debugger/create-custom-views-of-native-objects.md) documentation. Also, see the [C/C++ custom visualizer sample](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/master/CppCustomVisualizer) or the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample.

## See also

Expand Down
1 change: 0 additions & 1 deletion docs/debugger/visualizer-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ The Visualizer APIs are provided for users who want to write a visualizer for th
## See also

- [Walkthrough: Writing a Visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md)
- [How to: Write a Visualizer](create-custom-visualizers-of-data.md)
- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md)
Loading