public static void Serialize(ProjectSwitcherSettings d, string filePath) { XmlSerializer serializer = new XmlSerializer(typeof(ProjectSwitcherSettings)); using (TextWriter writer = new StreamWriter(filePath)) { serializer.Serialize(writer, d); } }