1

I have an rare data-dependent error in some code. It's difficult to reproduce the conditions that generated the problematic data, so I need to be able to serialize the (fairly large) data that causes the error to disk to make a test case. Is there any way to serialize data from the debugger?

  • possible duplicate of [Visual Studio how to serialize object from debugger](http://stackoverflow.com/questions/18794264/visual-studio-how-to-serialize-object-from-debugger) – yzorg Nov 21 '14 at 15:47
  • duplicate of http://stackoverflow.com/questions/18794264/visual-studio-how-to-serialize-object-from-debugger. This question is older, but newer answer has _much_ better answers (more useful). – yzorg Nov 21 '14 at 15:48

1 Answers1

1

Is all the data that you want already in some serializable form? If so, you could use the Immediate window to create an appropriate serializer and write it to disk that way.

If you need to do this reasonably regularly, and if you're after the data contained in a single object, you could add a method to that type to dump the data to disk given just a filename - and again, call that method from the Immediate window.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194