K
Kiavik
I'm developing a Windows Service which uses the FSW object to monitor
some UNC paths, now I know after reading this article
http://tinyurl.com/ykw7aq that FSW is quite unreliable when monitoring
UNC paths so in my service I've also implemented a Timer that stops and
restarts the FSW and checks for files that the FSW missed because it
wasn't intercepting events.
For testing purposes I've installed the service in my machine to
monitor a local path and set the timer to be triggered every 10
minutes. I left the service running over night and this morning I
checked the log file for the service and found that every once in a
while (at random intervals) the FSW raise an exception:
*System.IO.InternalBufferOverflowException* - Too many changes at once
in directory:C:\Pippo
The weird thing is that the directory hasn't been modified at all
during night so why the buffer overflow excepion? The only thing I can
think about is the reset of the FSW, maybe I do it wrong. To reset it I
set the *EnableRaisingEvents* FSW property to false and then back to
true. Is this the correct way? Or should I Dispose and recreate the
object? Or there is some other method to reset the object?
Thanks
some UNC paths, now I know after reading this article
http://tinyurl.com/ykw7aq that FSW is quite unreliable when monitoring
UNC paths so in my service I've also implemented a Timer that stops and
restarts the FSW and checks for files that the FSW missed because it
wasn't intercepting events.
For testing purposes I've installed the service in my machine to
monitor a local path and set the timer to be triggered every 10
minutes. I left the service running over night and this morning I
checked the log file for the service and found that every once in a
while (at random intervals) the FSW raise an exception:
*System.IO.InternalBufferOverflowException* - Too many changes at once
in directory:C:\Pippo
The weird thing is that the directory hasn't been modified at all
during night so why the buffer overflow excepion? The only thing I can
think about is the reset of the FSW, maybe I do it wrong. To reset it I
set the *EnableRaisingEvents* FSW property to false and then back to
true. Is this the correct way? Or should I Dispose and recreate the
object? Or there is some other method to reset the object?
Thanks