Everyone knows how to enhance Visual Studio’s debugging experience by applying DebuggerDisplay attribute (in polish). If not – read Piotr’s post here. That’s debugging 101. Here’s how to improve your experience even more.
DebuggerDisplay attribute is ok if you control the code and you can apply it to the type you want to expose in the debugger. What if you can’t do that? What if you want to attribute a build-in type? Is all hope gone?
No. There’s a way. There’s a hidden* .cs file and a dll that you can use for this purpose. There’s a file named autoexp.cs in “c:\Users\<user>\Documents\Visual Studio 2053\Visualizers\autoexp.cs”. Inside this file you will find the DebuggerDisplay attributes specification for build-in types.
You can add yours there – then compile the file to produce a dll and override the existing one. From that moment you can enjoy better visualisation of types that you can’t attribute with DebuggerDisplay attribute directly. in the Visual Studio.
So now you know and you can extend your debugging experience even more. Have a nice debugging!
* – not that hidden if you know where to look for it 😉
Founder of Octal Solutions a .NET software house.
Passionate dev, blogger, occasionally speaker, one of the leaders of Wroc.NET user group. Microsoft MVP. Podcaster – Ostrapila.pl