I'm trying to test/check contents of a dataset by writing it to an xml file
on the server, but get this error above.

The suggestion to grant access rights to the file doesn't work, as I don't
get a security tab when I right-click in order to add ASPNET as a User to
the file.

Anyway...

here is my code...

TextWriter t = new StreamWriter(context.Server.MapPath("dsCust.xml");
XmlSerializer xs = new XmlSerializer(typeof(Cotswold2.dsCustomerDetails)) ;
xs.Serialize(t, dsCust);

Error occurs on the first line. How can I grant either access rights,
although I'd have thought being able to write to an xml file on my web
server should be allowed in any case.