XmlSerializer - There was an error reflecting type

后端 未结 18 1628
借酒劲吻你
借酒劲吻你 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:36

    I was getting the same error when I created a property having a datatype - Type. On this, I was getting an error - There was an error reflecting type. I kept checking the 'InnerException' of every exception from the debug dock and got the specific field name (which was Type) in my case. The solution is as follows:

        [XmlIgnore]
        public Type Type { get; set; }
    

提交回复
热议问题