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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This article explains it well.
You can use this attribute on your classes to display a more meaningful text when you debug. For example:
Suppose you have a the following class:
Once you debug an instance of MyClass in the Visual Studio debugger and you hover over it (or put it in the Watch Window, you no longer see
"MyClass"there but instead"x = 4 y = 5"(assuming that x and y of this instance currently have this value. This is just an example you can do much more as the article explains it.