Serializing WITHOUT xmlns

前端 未结 4 1837
野性不改
野性不改 2020-12-17 10:30

I have a couple extension methods that handle serialization of my classes, and since it can be a time consuming process, they are created once per class, and handed out by t

4条回答
  •  抹茶落季
    2020-12-17 10:48

    A working solution, for the record!

    var ns = new XmlSerializerNamespaces();
    ns.Add("", ""); 
    var serializer = new XmlSerializer(yourType); 
    serializer.Serialize(xmlTextWriter, someObject, ns);
    

提交回复
热议问题