Hi,
im am using a XmlTextWriter in 2 different Methods. Each of them instantiates the writer and does a writer.close() at the end.
This works pretty fine, as long as I do not call the two methods one after the other. If I do this the second witer comes up with:
"it can not be written in a closed textwriter" in line 3.
Hase anyone got an idea what I am missing. Even if I instantiate the second writer to another variable it does not help.
I do not understand why the writer I just instantiated is closed?
Thanks for any help
Marcus
1: public void WriteToXML()
{
2: XmlTextWriter writer = new XmlTextWriter(Console.Out);
3: writer.Formatting = Formatting.Indented;
4: writer.WriteStartElement("xxx");
....
20: writer.close();
}