FileSystemWatcher fails

  • Thread starter Thread starter Rob Oldfield
  • Start date Start date
R

Rob Oldfield

I have an app (that should really be a service, but I haven't got round to
it yet) that just monitors a network folder via a filesystemwatcher for new
files and then does its thing. Generally, it works fine, but it fails about
once a month - which is about one every 2-3 hundred files. No error message
or exceptions... it just fails to notice that the file has appeared. After
that, any other new files are also ignored.

I'm thinking of switching to a dir function running every ten seconds or
so....but was wondering if anyone had any ideas about the situation.
 
Hi Rob,
Are you subscribing to the Error Event? Per the docs it sounds like an
internal buffer overflow which won't raise an excpetion but will raise the
FileSystemWatcher.Error Event. If the Error event is never being raised I'd
still play with the InternalBufferSize property to see if it has any affect.

You may also be able to get a dump when notifications stop and hunt down the
internal buffer to see if it's full or not just to verify whether or not this
is the case.

HTH,
Nathan
 
Back
Top