F
Frank
Hi,
I'm logging requests by opening the log file on each
Application_BeginRequest event with:
StreamWriter log = File.AppendText(logFilename);
This works most of the time but sometimes I get an IOException with the
message:
The process cannot access the file <filename> because it is being used by
another process.
Can this be caused by requests that occurr at the same time? (Threading)
Or if its another process (e.g. Virus scanner) should I keep the file open?
Make StreamWriter log static?
Any ideas on how to prevent this.
I'm logging requests by opening the log file on each
Application_BeginRequest event with:
StreamWriter log = File.AppendText(logFilename);
This works most of the time but sometimes I get an IOException with the
message:
The process cannot access the file <filename> because it is being used by
another process.
Can this be caused by requests that occurr at the same time? (Threading)
Or if its another process (e.g. Virus scanner) should I keep the file open?
Make StreamWriter log static?
Any ideas on how to prevent this.