Search code examples
c#dynamics-crmmicrosoft-dynamicsxmlserializerearly-binding

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. 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."}

Is the problem that it can't serialize IEnumerables? I'm not sure.

Thanks for your advice! :-)


Solution

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

    Serialize CRM entity using DataContractSerializer

    I hope this helps someone :-)