XmlSerializer - There was an error reflecting type

后端 未结 18 1613
借酒劲吻你
借酒劲吻你 2020-11-28 02:46

Using C# .NET 2.0, I have a composite data class that does have the [Serializable] attribute on it. I am creating an XMLSerializer class and passi

18条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 03:18

    Look at the inner exception that you are getting. It will tell you which field/property it is having trouble serializing.

    You can exclude fields/properties from xml serialization by decorating them with the [XmlIgnore] attribute.

    XmlSerializer does not use the [Serializable] attribute, so I doubt that is the problem.

提交回复
热议问题