I'm trying to add functionality to a simple web service that will allow me to log information to an XML file on the hard drive where the application is located. When I employ the functionality in a Console version of the application, the data gets logged to:
bin\x86\Debug MySolution.MyProject
\MessageLog\TestMessagess.xml
.
However, when I try to write read from or write to the XML file in the ASP.NET application, I get a System.UnauthorizedAccessException
with the message:
Accees to the path 'MessageLog' is denied.
I would like the log file to appear in the \bin
folder of the application directory, so what settings in IIS or on the server itself would I need to change to allow my application to read from and write to that folder?
My Machine: I'm using Windows XP SP3 with ASP.NET 4.0.