Serialization of DataWrapper<T>/WCF issue

Nov 13, 2009 at 6:47 PM

I have a single WCF service that contains methods that expects a xxxClientModel : EditableValidatingObject which contain properties that are DataWrapper<T>.  This all works great until I attempt to send one of these objects across the wcf transport to my service (using WCF netTcpBinding).  I get an error indicating a serialization problem.  I can comment out all properties of type DataWrapper<T> and the class will serialize just fine. 

During my investigation it appears that PropertyChangedEventArgs (type of member found in DataWrapper<T>) is not marked [Serializable()] in the .net framework.  I am not certain if this is the issue, but ultimately my question is this:

Can I serialize a type that contains properties of type DataWrapper<T>?  I have been able to prove that the same class with just commenting out all properties of type DataWrapper<T> will serialize just fine.  I tried modifying DataWrapper<T> a bit by marking all of the PropertyChangedEventArgs type properties with the [NonSerialized] attribute, but it does not seem to help.  Any ideas?  Can someone help with getting DataWrapper<T> to be serialized?  If not, do you have any recommended options? (Other than the obvious).  Thanks.



May 2, 2010 at 8:09 AM



You have it wrong Cinch is a UI framework, you should not be trying to send any Cinch object over any serializable boundary. You should be translating Cinch objects into some serializable object such as LINQ to EF or LINQ to SQL. That is what the demo app does.