开发者

'System.Xml.XmlDocument' cannot be serialized

开发者 https://www.devze.com 2023-03-18 22:07 出处:网络
I am using AppFabric caching in my C# application. I am attempting to cache a XmlDocument but getting the following error:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消