简体   繁体   English

早期绑定实体“ActivityPointers”上的XmlSerializer错误

[英]XmlSerializer error on early-bound Entity “ActivityPointers”

I'm getting a XmlSerializer error when I serialize an object with a refrence to an early-bound CRM entity. 当我将一个对象序列化为早期绑定的CRM实体时,我收到了一个XmlSerializer错误。 Have you seen anything like this and/or have any thoughts on how I can correct?... 你有没有见过这样的事情和/或对我如何纠正有任何想法?...

{"Cannot serialize member 'DataSync.ParseI17Xml.CrmEarlyBound.sevp_petition.sevp_petition_ActivityPointers' of type 'System.Collections.Generic.IEnumerable`1[[DataSync.ParseI17Xml.CrmEarlyBound.ActivityPointer, DataSync.ParseI17Xml, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', see inner exception for more details."} {“无法序列化'System.Collections.Generic.IEnumerable`1 [[DataSync.ParseI17Xml.CrmEarlyBound.ActivityPointer,DataSync.ParseI17Xml,Version = 1.0.0.0,Culture =]的成员'DataSync.ParseI17Xml.CrmEarlyBound.sevp_petition.sevp_petition_ActivityPointers'中性,PublicKeyToken = null]]',请参阅内部异常以获取更多详细信息。“}

Is the problem that it can't serialize IEnumerables? 问题是它无法序列化IEnumerables? I'm not sure. 我不确定。

Thanks for your advice! 谢谢你的建议! :-) :-)

Try converting it to a List first using .ToList(). 首先尝试使用.ToList()将其转换为List。

There was another answer for the same here 还有另一个答案同样在这里

So I worked this out. 所以我解决了这个问题。 It ended up being easier than I thought. 它最终比我想象的要容易。 The solution was to use a different serializer. 解决方案是使用不同的序列化程序。 The DataContractSerializer works perfectly. DataContractSerializer完美运行。

Serialize CRM entity using DataContractSerializer 使用DataContractSerializer序列化CRM实体

I hope this helps someone :-) 我希望这可以帮助别人 :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM