Points to remember while setting debugger display:
- Debugger identifies only the Property name placed inside the curly brace {Property}.
- Example: {Name}={PropertyName}.
- Nested Class Example : {ClassName.PropertyName}={Product.Name}.
Step 1: Namespaces used:
using System;
using System.Diagnostics;
Step 2: Usage:
protected void Page_Load(object sender, EventArgs e)
{
Book book = new Book();
book.Name = "Practical Demo";
book.Title = "CSharp";
book.Register = DateTime.Today;
Product product=new Product();
product.Name = "Programming";
book.Product = product;
}
Step 3: Class for demo:
[DebuggerDisplay("BookTitle{Title}-- {Name} , {Register}--{Product.Name}")]
public class Book
{
public string Title;
public DateTime Register;
public string Name;
public Product Product;
}
Step 4: Nested class for demo:
[DebuggerDisplay("ProductName{Name}")]
public class Product
{
public string Name;
}
Step 5: Format of Class Debugger Display:
[DebuggerDisplay("ProductName{Name}")]
Step 6: Format of Nested Class Debugger Display:
[DebuggerDisplay("BookTitle{Title}-- {Name} , {Register}--{Product.Name}")]
Step 7: Output:
Code Snippet:
using System;
using System.Diagnostics;
namespace SampleApplication.New
{
public partial class DebuggerDisplatClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Book book = new Book();
book.Name = "Practical Demo";
book.Title = "CSharp";
book.Register = DateTime.Today;
Product product=new Product();
product.Name = "Programming";
book.Product = product;
}
}
[DebuggerDisplay("BookTitle{Title}-- {Name} , {Register}--{Product.Name}")]
public class Book
{
public string Title;
public DateTime Register;
public string Name;
public Product Product;
}
[DebuggerDisplay("ProductName{Name}")]
public class Product
{
public string Name;
}
}
Thanks for reading this article.

Lajapathy ArunPosted Apr 24, 2012, 2:37 AM
thanks guys for the inspiration
Arjun PanwarPosted Apr 24, 2012, 12:01 AM
Hi...Paul Very Nice Presentation.
Arjun PanwarPosted Apr 24, 2012, 12:00 AM
Hi...Paul Very nice Presentation.
Arjun PanwarPosted Apr 23, 2012, 11:58 PM
Hi,, Very Nice Article but i want to know that how do you display the contents of your custom classes
Abhishek DubeyPosted Apr 23, 2012, 7:13 PM
Thanks Arun its a great efforts.
Lajapathy ArunPosted Apr 23, 2012, 1:20 PM
Thanks Luna
Lajapathy ArunPosted Apr 23, 2012, 1:18 PM
thanks lana