private static string ReadXsdFile(string fileName) { FileStream fs = null; try { fs = File.OpenRead(fileName); using (StreamReader sr = new StreamReader(fs)) { return sr.ReadToEnd(); } } finally { if (fs != null) { fs.Dispose(); } } }