public static void WriteProjects(JiraProjectCollection projects) { using (var fs = new FileStream(GetJiraProjectsFilePath(), FileMode.Truncate, FileAccess.Write)) { var xmlReader = new System.Xml.Serialization.XmlSerializer(typeof(JiraProjectCollection)); try { xmlReader.Serialize(fs, projects); } catch (Exception e) { } } }