4
votes

I recently upgraded my VS solution and projects from 3.5 to 4.0 framework. After conversion I am facing a problem when sending entity objects to WCF. When I send an entity which has no other child entities or any relation with other entities, everything works fine... the data is passed to WCF. But when the entity has a child entity I get the following error when calling my WCF service method:

The EntityReference object could not be serialized. This type of object cannot be serialized when the RelationshipManager belongs to an entity object that does not implement IEntityWithRelationships.

Any idea what's gone wrong? I wasn't facing any issues when using framework 3.5.

1
To be clear, you're passing the whole EF generated class (3.5-style, not a POCO) over WCF including the extra -Field properties and the EntityKey and EntityState properties? You probably want something lighter-weight for data transfer. Not sure if that's directly related to this error, though.Rup

1 Answers

1
votes