创建序列化对象修改为下面的方式创建即可 XmlSerializer s = XmlSerializer.FromTypes(new[] { typeof(CustomXMLSerializeObject) })[0];