I've got an intermittent problem when trying to write to a text file (used a
s
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?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.
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
_________________________
"recoil@.community.nospam" <marc.derider@.gmail.com> wrote in message
news:1111423728.382376.5840@.o13g2000cwo.googlegroups.com...
> 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.
>
0 comments:
Post a Comment