'System.Xml.XmlDocument' cannot be serialized
I am using AppFabric caching in my C# application. I am attempting to cache a XmlDocument but getting the following error:
Type 'System.Xml.XmlDocument' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all开发者_运维技巧 of its members you want serialized with the DataMemberAttribute attribute.
How can I resolve this issue?
Had the same issue, and solved it by marking the property/field that contained the XML document as NonSerializable.
精彩评论