Search code examples
c#visual-studiovisual-studio-2013visual-studio-debugging

Inspect all objects of all types in visual studio debugger?


Is there a way , in VS 2013 debugger, to inspect all currently available objects in the process? (which haven't been disposed yet by the GC)

For example, at a certain point in the execution there are 3 instances of type A and 2 instances of type B. I'd like to pause the execution and inspect them all


Solution

  • You can do so with debugging tools such as WinDBG - just save a process dump with VS, open WinDBG and type the following commands:

    .symfix .reload .loadby sos clr !dumpheap -stat

    You can also archive similar functionality in VS by using some debugging plugins, such as Oz Code, by right clicking the type and showing all instances for each type - press the Show Instances of type button on the toolbar and just enter any substring of the types fully qualified name, like this:

    enter image description here