J
john_smith_677
Hi,
I moved some code from my project to a separate assembly. I have some
saved definitions that were saved using regular .net serialization.
When trying to open the saved definitions, I get type load
exceptions. I am getting around this by implementing my own
SerializationBinder and forwarding the typenames to the new assembly.
I successfully forward all the types but yet I still get a type load
exception later on in the deserialization. It seems the formatter is
still referencing the old type name instead of the forwarded one. I
should also mention that the type that generates the error is a
parameter to another type which is generic. I can't think of a way
around this and so I can't open any saved definitions right now. I'm
hoping one of you guys knows a solution.
Here's the stack trace of the framework part of the exception:
at System.Reflection.Assembly.GetType(String name, Boolean
throwOnError, Boolean ignoreCase)
at System.UnitySerializationHolder.GetRealObject(StreamingContext
context)
at
System.Runtime.Serialization.ObjectManager.ResolveObjectReference(Objec
tHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize
(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck,
Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserial
ize(Stream serializationStream, HeaderHandler handler, Boolean fCheck,
Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserial
ize(Stream serializationStream)
Thanks
I moved some code from my project to a separate assembly. I have some
saved definitions that were saved using regular .net serialization.
When trying to open the saved definitions, I get type load
exceptions. I am getting around this by implementing my own
SerializationBinder and forwarding the typenames to the new assembly.
I successfully forward all the types but yet I still get a type load
exception later on in the deserialization. It seems the formatter is
still referencing the old type name instead of the forwarded one. I
should also mention that the type that generates the error is a
parameter to another type which is generic. I can't think of a way
around this and so I can't open any saved definitions right now. I'm
hoping one of you guys knows a solution.
Here's the stack trace of the framework part of the exception:
at System.Reflection.Assembly.GetType(String name, Boolean
throwOnError, Boolean ignoreCase)
at System.UnitySerializationHolder.GetRealObject(StreamingContext
context)
at
System.Runtime.Serialization.ObjectManager.ResolveObjectReference(Objec
tHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize
(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck,
Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserial
ize(Stream serializationStream, HeaderHandler handler, Boolean fCheck,
Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserial
ize(Stream serializationStream)
Thanks