I would like to control the creation of an object of a type that usually does not serialize during deserialization using the NetDataContractSerializer (or some kind of serializer, I think). Using the custom SerializationBinder, I can control the built type and use the custom ISurrogateSelector and ISerializationSurrogate to control how the state is set on the object.
What I cannot do is actually create an object to allow using dependency injection or something else. The object causing the problems is inside the graph of the object, so I cannot edit it before serialization.
Is there a way to allow my code to create a deserialized object?
(For the background, I am writing a custom WF4 instance store based on XmlWorkflowInstanceStore in WF samples. I want to create workflows with variables that are interfaces ... and specific types cannot be built directly. XmlWorkflowInstanceStore is the only example I can find in user persistence, and it uses the NetDataContractSerializer to serialize the state of the workflow.)
source
share