c# - How to get rid of the xmlns when using xml serialization -


i don't want following appended root element

xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema">

what should when using xml serialization.

by using serialize method:

public class foo { }  class program {     static void main()     {         var foo = new foo();         var serializer = new xmlserializer(foo.gettype());         var ns = new xmlserializernamespaces();         ns.add(string.empty, string.empty);         serializer.serialize(console.out, foo, ns);     } } 

notice last argument (ns).


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -