XMLTextWriter question
-
I have a web service listener that has a function that generates an XML file. For some reason, it cannot get past the line of code below with the asterix string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag); XmlTextWriter writer = null; writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);***************************** writer.Formatting = Formatting.Indented; writer.WriteStartDocument (); This code works fine on my form application. Is there something i am missing. Any input is appreciated. Thanks, Colin
-
I have a web service listener that has a function that generates an XML file. For some reason, it cannot get past the line of code below with the asterix string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag); XmlTextWriter writer = null; writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);***************************** writer.Formatting = Formatting.Indented; writer.WriteStartDocument (); This code works fine on my form application. Is there something i am missing. Any input is appreciated. Thanks, Colin
-
Most probably a security issue... your webservice listener must be running under a user account (ASPNET?) that does not have permission to write to the root of you c:\ drive. Roel
-
I have a web service listener that has a function that generates an XML file. For some reason, it cannot get past the line of code below with the asterix string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag); XmlTextWriter writer = null; writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);***************************** writer.Formatting = Formatting.Indented; writer.WriteStartDocument (); This code works fine on my form application. Is there something i am missing. Any input is appreciated. Thanks, Colin
-
LCI wrote:
This code works fine on my form application. Is there something i am missing.
You mean like the exception information? :rolleyes:
led mike
-
Thanks for the reply. The exception information is even more baffling. It basically says that access is denied to C:\WINDOWS\System32\This.xml The path that i am telling the code to generate the XML is C:\Test\This.xml Any thoughts are appreciated. Thanks,