Locohost
Locohost

Reputation: 1702

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! :-)

Upvotes: 1

Views: 89

Answers (2)

Locohost
Locohost

Reputation: 1702

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 :-)

Upvotes: 0

Jordi
Jordi

Reputation: 1470

Try converting it to a List first using .ToList().

There was another answer for the same here

Upvotes: 0

Related Questions