Serialization Woes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a type that is serializable that is located in an assembly that is
loaded dynamically from a special directory. When deserializing this object
the framework fails to find the type.

Now, I am aware of the SerializationBinder class and how it can be used to
get around this problem however that only works when you are dealing with the
formatters yourself and have the ability to set the binder class. In my
case, I have an object that needs to go on the Clipboard.
The problem is that it isn't being handled correctly. How do I deal with
this case?

Thanks.
 
I could be completely off-base here, because I've never had to do this for
serialization, but you might want to look into creating an
AppDomain.TypeResolve event handler to resolve the type.

I've never used TypeResolve, but I have used ResourceResolve and
AssemblyResolve and it sounds like it might fit the bill for you.

Pete
 
Thanks! I will look into that.

Pete said:
I could be completely off-base here, because I've never had to do this for
serialization, but you might want to look into creating an
AppDomain.TypeResolve event handler to resolve the type.

I've never used TypeResolve, but I have used ResourceResolve and
AssemblyResolve and it sounds like it might fit the bill for you.

Pete
 
This didn't work. In fact it never fired. However, I know the problem has
something to do with it being in the dynamically loaded assembly because when
I move the definition out into the main executable it works appropriately.

Any other suggestions?
 
Back
Top