I looked in MSDN and in reflector, but couldn't figure it out usually - i get all this information from the description tags, but in this case - no such luck.
I already figured out with experiments:
- "access is denied" [Win32Exception, native error code=5] if the watched directory is being deleted
- "too many changes an once" [InternalBufferOverflowException] if the buffer is overflown.
any more ideas?
There also can be UnauthorizedAccessException, when you do not have rights to access folder or specific file.
Also, do not rely heavily on basic FileSystemWatcher,even without InternalBufferOverflowException it can skip some events and works very,very badly of network directories. You should use combine FileSystemWatcher with some polling-style system, for example, run directory scanning every 30 seconds target directory and compare your current, FileSystemWatcher based files list, with real situation, that way you'll have MOST of actual information in real time and ALL information periodically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With