Help, Guru!: serialize/deserialize derived class between two application?
-
how to serialize/deserialize derived class between two application? here is the situation: class container { BaseClass bc; } class BaseClass {..} class DerivedClass1:BaseClass {...} class DerivedClass2:BaseClass {...} ------------------------------------------ the "bc" in the container can be assigned to be DerivedClass1 or DerivedClass2. Those classes and serialize/deserialize functions will be use between two applications (App1, App2). App1 serialize "container", App2 try to deserialize "container". I tried following ways: 1. Binaryformatter/Soapformatter: During the serialization, App1's name will also be serialized. When App2 try to deserialize, it can not find App1 and generate exceptions. 2. XmlSerializer: it can not serialize when "bc" is assgined to a class other than BaseClass Any guru have any good method to handle this situation? Thanks, Leo