Coming soon!

Details from a collection while debugging in Visual Studio

Show more specific information on your domain or dto object in a collection while debugging your C# code in visual studio

  • visual studio 2015
  • c#
  • debugging
  • Tips & Tricks

By Joris Brauns · 1/27/2016 12:55:35 PM (Original Post)

How often does it happens, when you would like to get more specific details on several of your object properties in a collection during debugging while clicking on the collection? For me a hell of a lot of times!

We've all been there, drilling down that endless object list while debugging, accidentally clicking next to the box so we have to start all over again - Benjamin Todts

Here is a trick which already exists since .net Framework 3.0

[DebuggerDisplay("{ID}", Name = "{Name}")] public class Code {
public int ID { get; set; } public string Name { get; set; } }

Which results in:

Find out all details at msdn:
https://msdn.microsoft.com/en-us/library/x810d419.aspx


  • visual studio 2015
  • c#
  • debugging
  • Tips & Tricks

By Joris Brauns · 1/27/2016 12:55:35 PM (Original Post)

Share this blogpost

Looking for talent?

Fill in the form below and we’ll get back to you as soon as possible.

Oops. You seem to have written your full name in invisible ink. Please enter it so we can read it. Oops. You seem to have written your company in invisible ink. Please enter it so we can read it. It seems your e-mail doesn’t exist. Please enter a real one so we can contact you. Oops. You seem to have written your telephone in invisible ink. Please enter it so we can read it.