tags:

views:

136

answers:

3

I have a FileSystemWatcher that processes files based on file system events. After awhile, the process is still alive, but it no longer detects the file system events. The process watches a local network share drive.

Anything I should be watching out for?

+3  A: 

Most likely small drops in network connectivity. Check this article.

Basically:

  • set watcher.EnableRaisingEvents = true
  • add an event handler to watcher.Error

Then re-bind on error.

Jan Jongboom
thanks, sounds like a good thing to try, since i'm sure i don't watch for it.
Timmy
Thanks, turns out I had an "The network BIOS command limit has been reached" which can easily be googled.
Timmy
+2  A: 

I guess I better post the answer instead of leaving it in the comment: did you implement the Error event? When you do get errors, bump up the value of the InternalBufferSize property. Try 16384.

Hans Passant