System.data.linq.binary Cannot Be Serialized
Hi everyone, Has anyone got this error before?? System.Data.Linq.Binary cannot be serialized because it does not have a parameterless constructor. I have a LINQ entity which has a field called recordVersion where I control concurrency. This field is a system.data.linq.binary type.
I am not sure if I can serialize this field and I guess this error is happening because of this field. My scenario is a web application calling a web service which uses LINQ to query my database and return a List of any LINQ entity.
Nov 10, 2013 System.Xml.Linq.XDeclarati on cannot be serialized because. File as binary. Is that the timestamp column is mapped as a System.Data.Linq.Binary property. Cannot be serialized. The Trumpet Sample Modeling Crack. Serialization issue with timestamp in LINQ. LINQ to SQL Serialization. LINQ to SQL classes cannot be serialized by XML serializer if there is a. == typeof (System.Data.Linq.Mapping. [InvalidOperationException: System.Data.Linq.Binary cannot be serialized because it does not have a parameterless constructor.].
What should I do? Does anybody have a suggestion? How To Program A Sylvania Tv With A Universal Remote.
Many thanks, Andre. Hai am using Asp.net 3.5, Visual Studio 2008. That really didn't solve the problem. Unlike String, Binary does not have a parameterless (default) constructor (as per the error message in the original post).
This means that it cannot be serialized using asmx web services. As a result, the entity cannot be passed back and forth between the web service and client apps. Changing the type in the dbml file to byte[] also shows the same problem. Byte[] does not have a default constructor. I have tried using my own Binary type, but Linq complains that there is no mapping between 'MyBinary' and 'rowversion'. Because the property is located in the generated code, we cannot directly add attributes to specify custom serialization. We are not using WCF, so cannot use the DataContract style of serialization (which is supported by the Binary type).