I want to write a new XML file to disk but the following code gives an error.
static void Main(string[] args)
{
using (XmlWriter writer = XmlWriter.Create(@"C:\abc.xml"))
{
writer.WriteStartDocument();
writer.WriteStartElement("Employees");
writer.WriteEndElement();
writer.WriteEndDocument();
}
Console.ReadKey();
}
Can anybody help me with this?
Note: abc.xml does not already exist.
