This extension allows you to view a visual dump of your objects during the debugging of the program in Visual Studio
Visual Dump window from
View => Other Windows and call
.Dump() with object you need during debugging!
The debugging process is one of the most important development processes and the ability to view visual interpretation of objects is an essential part of modern debugging.
I believe that
Visual Dump is able to make it easier and clearer!
How often does Visual Studio render your objects in the Watch/Locals/etc windows in the different way you wanted?
Have you never wanted to view the state of objects in a more visual form?
Have you never wanted to easily change the process of how your objects are rendered?
Personally, I do
Once I met a wonderful 'LINQPad' by Joseph Albahari I just fell in love with the
Dump function! Enjoying her flexibility and beauty, I caught myself thinking that I wanted to see something similar in Visual Studio
And I did it!
So proud to present you the
Visual Dump extension!
Visual Dump is really simple to use!
- Open your Visual Studio
Visual Dump window from
View => Other Windows
- Open project you need
- Add a call to the
.Dump() function where it's necessary
- Run your project
If you need to disable the dumping, you don't need to delete all
.Dump() calls: just call
DumpExtensions.DisableDumping() and each
.Dump() will start simply returning the same object it received without any side effects!
Let's dump something:
Matrix 10x10 (
Visual Studio vs
As you can see,
.Dump() returns the same object that it received, so it can be used with objects like
StringBuilder or in those places where the functional approach is used (etc)
Also in order not to lose an object among other dumps, you can set a header for it by passing the necessary string parameter to
If the visual dump takes up too much screen space, you can minimize it by clicking the arrow in the table's header
Reorganization of elements in an array
For example, we have an array of some elements whose dump looks like this:
We can rebuild them into a more compact form: just click on the pickaxe icon (to return everything as it was, click on it again):
Feel free to use
.Dump() inside Immediate/Watch and similar windows:
Visual Dump has 2 themes:
Dessader Theme (In honor of my friend who helped me with it and package's icon)
LINQPad Theme (For those who are used to LINQpad)
You can simply select theme you like using options window:
Auto clear is active,
Visual Dump window we'll be automatically cleared when starting a new project)
How can I provide my own dumping rule?
This is much easier than you might think! Just follow these simple steps:
- Define some class and inherit it from
- Mark your class with
ExportHTMLProviderAttribute, specifying the type for which you want to apply your dumping rule
- Override method
object Obj is object passed for dumping
Stack<object> CallStack is dumping stack. If you need to call another dumping providers, you must push current object to cloned stack and pass it to next ToHTML method
objetc Args - arguments from user code (do whatever you want with them)
So, we'll get something like this as result:
Visual Dump is compatible with any .NET language and platform:
- .NET Framework 4.5+ (
- .NET Core 2.0+ (
- .NET Standart 2.0+ (
Visual Dump supplies several snippets for your convenience:
didebug - Inserts code that activates Dumping only with DEBUG:
direlease - Inserts code that activates Dumping only with RELEASE:
DIDEBUG - Inserts code that activates Dumping only with DEBUG:
DIRELEASE - Inserts code that activates Dumping only with RELEASE:
Microsoft, where is the support for snippets for
- 1.0 - Initial release
- 2.0 - Some cool improves:
- You no longer need to call
DumpExtensions.EnableDumping() to activate Dumping! (#4)
IOException: The semaphore timeout period has expired during some calls to
Visual Dump initialization is much faster now!
- Fixed Visual Studio 2019 installation exception (#2)
- 2.1 - Now all my extensions work on the basis of a single API, which made it possible to simplify some things