Questions tagged [debuggerdisplay]

The DebuggerDisplay attribute can be added to a class, structure or many other elements of your code. The attribute includes a single argument that is supplied as a string. This string is displayed in debugger windows instead of the object's class name or the results of the ToString method.

The DebuggerDisplay attribute can be added to a class, structure or many other elements of your code. The attribute includes a single argument that is supplied as a string. This string is displayed in debugger windows instead of the object's class name or the results of the ToString method. The string can contain references to fields, properties and methods in the class so that the actual values from an object may be included in its description. It may also include simple expressions.

From http://www.blackwasp.co.uk/DebuggerDisplay.aspx

27 questions
2
votes
1 answer

Show DebuggerDisplay in PropertyGrid C#

I was wondering if it is possible to have the debugger display be the text for the class in the PropertyGrid? I cant seem to find this answer anywhere. Here is an example of what I have. [DebuggerDisplay("FPS =…
Chris Watts
  • 2,284
  • 4
  • 23
  • 28
2
votes
3 answers

When we must use DebuggerDisplay Attributes? What is the advantage of using this?

When we must use DebuggerDisplay Attributes? What is the advantage of using this?
masoud ramezani
  • 22,228
  • 29
  • 98
  • 151
2
votes
1 answer

DataTable descendant with DebuggerDisplay attribute loses DebuggerVisualizer

I have a descendant of DataTable that has the DebuggerDisplay attribute defined. The default visualizer for DataTable is removed when I add the DebuggerDisplay attribute. If I remove the DebuggerDisplay attribute, the DataTable visualizer returns. I…
Steve
  • 2,153
  • 4
  • 22
  • 31
1
vote
1 answer

DebuggerDisplayAttribute has no effect in VS 2017

It seems like the DebuggerDisplayAttribute is not having any effect in Visual Studio 2017 (15.9.4) with Resharper 2018.2.3. Placing the attribute in AssemblyInfo.cs, or in Program.cs, has no discernible effect. I am targeting .Net Framework…
user47589
1
vote
1 answer

How to make DebuggerDisplay work for composite types in Dictionary?

In an attempt to pleasantly display a Dictionary's content, I wrote this: [assembly: DebuggerDisplay("{Key,nq} -> {Value,nq}", Target = typeof(KeyValuePair<,>))] namespace test { [DebuggerDisplay("{DebuggerDisplay,nq}")] public class Thing…
Tar
  • 8,529
  • 9
  • 56
  • 127
1
vote
4 answers

DebuggerDisplay - type in square brackets

class A { public Color ColorA { get; set; } public Color ColorB { get; set; } public A(Color colorA, Color colorB) { ColorA = colorA; ColorB = colorB; } public override string ToString() { return…
sventevit
  • 4,766
  • 10
  • 57
  • 89
1
vote
1 answer

Is it possible to use conditions in a DebuggerDisplay in VB.NET?

I ask the question asked here again because the answer is not suitable for VB.NET: Consider the following class: [DebuggerDisplay("{GetType().Name,nq}: FileName = {FileName,nq}")] public class FileWrapper { public string FileName { get; set;…
codeDom
  • 1,623
  • 18
  • 54
1
vote
1 answer

Can I use DebuggerDisplay info in Unit Tests?

Something like: Assert.AreEqual("Id=7, Name=John", someClass.DebuggerInfo);
1
vote
2 answers

DebuggerDisplay attribute on a DebuggerTypeProxy Class

When using [DebuggerDisplay("{OneLineAddress}")] on the debugger proxy'd class, it does not seem to work. Is there something I'm doing wrong? Or some way around this without adding code to the original…
playerone
  • 127
  • 1
  • 8
0
votes
0 answers

(Solved) C# DebuggerDisplay ignored for a specific class

Visual Studio 2022 is ignoring the "DebuggerDisplay" attribute for one of my classes, and I would really appreciate help figuring out why. I have several classes using [DebuggerDisplay("{DebuggerString}")] including others inheriting from VM, and…
A Piranha
  • 35
  • 4
0
votes
1 answer

Cross language DataRow index in DebuggerDisplay

I am trying to customize debugged objects tooltips. To achieve this I have a library including Assembly: DebuggerDisplay attributes (Can the DebuggerDisplay attribute be applied to types one doesn't own?) in Visualizers folder (How to: Install a…
IvanH
  • 5,039
  • 14
  • 60
  • 81
-1
votes
1 answer

Common DebuggerDisplay attribute implementation

I'm trying to implement the common/general DebuggerDisplay attribute to avoid formatting it for every single usage which would simply show every property of the class. That's what I've achieved so far, my extension method looks like this public…
VladL
  • 12,769
  • 10
  • 63
  • 83
1
2