Unable to create xml file

moschino

New Member
I am trying to create an xml document with the information that is taken from a test. Basically I am using \[code\]{get; set:}\[/code\] to get the information and when I walk through the program you see where the file information is passed through but I either get the error unable to create the xml document or it is created but is blank. Here is the code: \[code\]public class XmlCreate { public string Types { set; get; } public DateTime Time { get; set; } public bool done{ get; set; } public void SerializetoXml(IRepo repo) { var filename = string.Format("{0}__{1}", DateTime.Now.ToString("yyyyMMdd"), "Log.xml"); var path = @"C:\TestDocs\artifacts"; if (!Directory.Exists(path)) Directory.CreateDirectory(path); var fullpath = Path.Combine(filename, path); var serializer = new XmlSerializer((typeof(IRepo))); var textwriter = new StreamWriter(filename); serializer.Serialize(textwriter, repo); textwriter.Close(); } }\[/code\]
 
Top