Given an object obj of some class A, doing typeof(obj) gives a System.Type object representing A
Type objsType = obj.GetType();
I want to serialize (using BinaryFormatter) the object objsType and persist on disk so another module running in another AppDomain can deserailse it into a Type object even though it has no reference to the assembly in which A is defined.
when I try to deserialze, I get an error saying the currently executing module could not find the assembly that defined A.
How do I fulfill my requirement without running into errors? Is there a way to do this?
Thanks so much in advance.
You can’t really do that. Types in .Net are closely tied to their assemblies and you can’t load a type without first loading its assembly.