Home

Calling Dump() several times on the same object instance not working as expected

Hello,

in case I run the following code, I get two tabs in the results panel called "Dump 1" and "Dump 2", each showing the objects' properties and values as I would expect:

var myClass1 = new MyClass(); myClass1.Foo = "Foo"; myClass1.Dump("Dump 1"); var myClass2 = new MyClass(); myClass2.Foo = "Bar"; myClass2.Dump("Dump 2");

However, in case I run the following code, I only get one tab called "Dump 1", which shows the output of the second dump call (the value of "Foo" is "Bar"):

var myClass = new MyClass(); myClass.Foo = "Foo"; myClass.Dump("Dump 1"); myClass.Foo = "Bar"; myClass.Dump("Dump 2");

I'd have expected to get two tabs called "Dump 1" and "Dump 2" as in the first case, each showing the state of the object from the moment Dump() was called. Or in case several dump calls on a single object overwrite each other, I would have expected the tab to be called "Dump 2" instead of "Dump 1".

I have tested this with LINQPad 4.55.03 and 5.00.08 and they both show this behavior.

Not an urgent issue, but being able to see all dumps for a single instance would be really handy for comparing the different states of an object :-)

Best regards,
Frederik

Comments

  • You're using 'Dump to Grids' mode, right?

    If so, this is the correct behavior. Dump to grids shows a datagrid that runs in your own process, so it shows the data in its final form. It does not do a 'snapshot' like dump to rich text.

    This is why 'Dump to grids' has no limit on the number of rows or nesting depth, etc. It does not walk the object graph duplicating everything.
Sign In or Register to comment.