I\'m trying to investigate a bug in a crash dump (so I can not change the code). I have a really complicated object (thousands of lines in the serialized representation) and
I have an extension method I use:
public static void ToSerializedObjectForDebugging(this object o, FileInfo saveTo)
{
Type t = o.GetType();
XmlSerializer s = new XmlSerializer(t);
using (FileStream fs = saveTo.Create())
{
s.Serialize(fs, o);
}
}
I overload it with a string for saveTo and call it from the immediate window:
public static void ToSerializedObjectForDebugging(this object o, string saveTo)
{
ToSerializedObjectForDebugging(o, new FileInfo(saveTo));
}