Hi,
I have the following class.
Assembly: A.dll
public class Customers {
public Customer[] customer;
}
public class Customer {
public string name;
public string country;
public object obj;
}
The basic need is to serialize this. But the constraint is.. Customer.Obj
can contain a Type of either "Order" or "Product" at runtime. This actual
type is not known at design time. For this I use XmlAttributeOverrides to
override the Type and Serialize it. However it seems to require that the
definitions for "Order" or "Product" Types be present within the assembly
A.dll itself where the code to serialize is present. But in my case it would
be present in another assembly (say) B.dll.
To make it more clear - A.dll contains the "Customers" type to be serialzed.
The types that Customer.Obj can take at runtime are defined in B.dll. The
code to serialize the "Customers" type by using XmlAttributeOverrides is also
present in A.dll. Now, this does not work as the definitions for the types
that Customer.Obj can take are in B.dll. However if I move definitions for
the types that Customer.Obj
can take inline into A.dll, it works fine.
So, How can I override attributes present in a different dll using
XmlAttributeOverrides.
Thanks and Regards,
Kishore