w3wp locking a text file

G

Guest

I've got an intermittent problem when trying to write to a text file (used as
a log). ASPNET has modify on folder, and at times logs to file, then I get a
null reference exception, followed on re-attempt with a "being used by
another process" exception. I then have to recycle the w3wp.exe process,
IIS, and sometimes re-deploy the application on the file system. Seems for
some reason the filesystem cannot see the file... Moreove, if I delete the
text file and recreate it manually, I'll ALWAYS get the error. I'm stumped.

Anybody out there experience similar?
 
R

recoil

When writing to the file do you make sure that you flush, close and
dispose of the file properly. Possibly put your File logging code
inside a try / catch / finally where the finally flushes and closes the
file properly.

I have heard other people have issues with file locking, primarily with
Image manipulation but I personally can say I have never experienced
any of these wierd behaviors.
 
A

Alvin Bruney [ASP.NET MVP]

it could also be due to your indexing service. try turning it off or
configuring it to not use that specific directory

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top