Re: System.ArgumentException: Stream was not writable?

C

Craig Deelsnyder

I am having trouble writing a file stream to a file. I get the following error:

Exception Details: System.ArgumentException: Stream was not writable.

Source Error:

Line 108: //xmlDataSet.WriteXml(Server.MapPath("/xml/rss.xml"));
Line 109:
Line 110: rssDocument.Save(fs);
Line 111: fs.Close();
Line 112: panel1.Visible = false;

I am sure I am overlooking something small, but I can't seem to figure it out. Any help would be appreciated.

does aspnet user have write access to whatever folder fs is pointing at?
Also make sure the file is not locked, perhaps by another write process...
 
G

Guest

Yes, aspnet has permissions on that folder. I gave it full control just for troubleshooting purposes. And the only thing that is trying to access the file right now is this code behind page. The file I am trying to is not locked either, because I can still write to it using notepad. :-/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top