Hello,
I get an InvalidOperationException when I try to serialize an exception like
this:
System.Xml.Serialization.XmlSerializer x = new
System.Xml.Serialization.XmlSerializer(typeof(Exception));
System.IO.StringWriter sw = new System.IO.StringWriter();
x.Serialize(sw, new Exception("My Test"));
and I have read this on a newsgroup:
This is a "ByDesign" XmlSerializer behavior: we do not serialize classes
with members that have security demands on them. This will be changed in the
next version to allow the members with security attributes, and generate
code that use reflection instead of direct accessors.
Any ideas on how to do it?
Best regards
Henrik Skak Pedersen