Serializing without XmlInclude

后端 未结 2 1227

I\'m deserializing a class called Method using .NET Serialization. Method contains a list of objects implementing IAction. I originall

2条回答
  •  佛祖请我去吃肉
    2021-01-02 01:32

    XmlSerializer has a constructor that accepts an array of types that will be accepted when deserializing:

    public XmlSerializer(
       Type type,
       Type[] extraTypes
    );
    

    You should be able to pass your array of assemblyTypes as the second argument.

提交回复
热议问题