开发者

'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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜