Skip to content

Instantly share code, notes, and snippets.

Created October 17, 2018 20:20
What would you like to do?
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