开发者

in C++/CLI

When I'm trying serialize a class containing this property:

[NonSerialized]
property System::Collections::ObjectModel::ReadOnlyCollection<String^>^ IgnoredWords

I get a compilation error saying:

fatal error C1093: API call 'DefineCustomAttribute' failed '0x801311c0'

How do I tell the serializer that I do not want 开发者_如何学Cto serialize this property (and, yes, by default it tries to, which causes a run time error)?


(inferring from xml-serialization tag) You want [XmlIgnore] for XmlSerializer.

[NonSerialized] is for BinaryFormatter etc, and only applies to fields, not properties (which is probably why you are getting DefineCustomAttribute failures).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜