I'm trying to get my web server to write logs to a txt file on the server. It should be simple and it is working fine on my development machine but it doesn't on the server. I have followed he advice in this: IIS7 Permissions Overview - ApplicationPoolIdentity
But it still won't write. the path is correct and it should have the proper permissions after following the above link. my code for writing the file is:
private void Logger(String lines)
{
String fileName = DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + "_Logs.txt";
try
{
System.IO.StreamWriter file = new System.IO.StreamWriter("C:/Web_Srvice_Logs/" + fileName, true);
file.WriteLine(lines + " " + DateTime.Now.ToString());
file.Close();
}
catch (Exception) { }
any Ideas?