FileSystemWatcher fails

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.
 
G

Guest

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
 

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

Top