Skip to content

Instantly share code, notes, and snippets.

Created October 17, 2018 20:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Laoujin/9b0b360b0c0cb39143990e92fa3adcef to your computer and use it in GitHub Desktop.
C# XmlSerialization
<?xml version="1.0" encoding="utf-8"?>
<Person xmlns:xsi="" xmlns:xsd="">
Copy link

Laoujin commented Oct 17, 2018

XmlSerializer serializer = new XmlSerializer(typeof(Person));
var writer = new StreamWriter(@"c:\temp\person.xml");
var person = new Person() {name = "testy"};
serializer.Serialize(writer, person);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment