Questions tagged [serializationbinder]

6 questions
8
votes
1 answer

Not able to deserialize Lazy object

I want to Serialize and DeSerialize an object which contains a Lazy Collection of some custom objects. Normally everything works perfectly fine but, if namespaces of classes used for serialization are changed, then this issue occurs. I have…
4
votes
3 answers

What is the best way to deserialize generics written with a different version of a signed assembly?

In other cases it has been suggested that you simply add a SerializationBinder which removes the version from the assembly type. However, when using generic collections of a type found in a signed assembly, that type is strictly versioned based on…
Rick Minerich
  • 3,078
  • 19
  • 29
2
votes
1 answer

Problem with Lists of custom type and Serialization

We are working on releasing version 2.0 of one of our products, and we want to maintain file compatibility with the installed base of version 1.0 customers. I have been implementing ISerializable on most of the types in our application, and seem to…
1
vote
1 answer

"System.Collections.Generic.List`1" SerializationBinder BindToType

I have a web service which searializes and returns the following to a client as an array of bytes: [Serializable] public class MyFile { public byte[] Data; public string FileName; } That is, I return a List(Of MyFile) to the client. It is…
Bill Roberts
  • 1,127
  • 18
  • 30
0
votes
1 answer

Data object update using SerializationBinder and Surrogate

I am getting a Object of type 'Project1.Class1[]' cannot be converted to type 'Project2.Class1[]'.' when trying to take the data from class1 project 1 to project 2 The object getting passed is a List of Project1.Class1 that contains a subobject of…
0
votes
0 answers

How can we get another type of object while deserialization in DataContractSerializer?

In case of versioning of object, if the old version object is serialized and now I need deserialized object of new version. I have checked over internet and observed that we can use SerializationBinder for that purpose. But I have no idea how can I…