How do I use an XmlSerializer to deserialize an object that might be of a base or derived class without knowing the type beforehand?

前端 未结 5 1731
长情又很酷
长情又很酷 2020-12-08 15:21

In C#, how do I use an XmlSerializer to deserialize an object that might be of a base class, or of any of several derived classes without knowing the type befor

5条回答
  •  独厮守ぢ
    2020-12-08 16:16

    You could try to use the constructor XmlSerializer(Type type, Type[] extraTypes) to create a serializer that works with all involved types.

提交回复
热议问题