FileSystemWatcher delete network file raises too many events error

  • Thread starter Thread starter Laogui
  • Start date Start date
L

Laogui

InternalBufferOverflowException - too many changes at once

regardless of how I large I set the buffer size.

All other events handle fine, Create Move rename Change, and Delete works on
a local drive.

I am Using Visual Studio 2005, C#, Net Framework 2 SP2

Does anyone have any knowledge of this issue, and is there a workaround?


watch.EnableRaisingEvents = true;
watch.SynchronizingObject = this;

watch.Error += watch_Error;
watch.Changed += new FileSystemEventHandler(watch_Changed);
watch.Created += new FileSystemEventHandler(watch_Created);
watch.Deleted += new FileSystemEventHandler(watch_Deleted);
watch.Renamed += new RenamedEventHandler(watch_Renamed);

watch.Path = _watchPath;
watch.Filter = _filePattern;
watch.IncludeSubdirectories = true;
watch.InternalBufferSize = something * 4096;

watch.NotifyFilter = NotifyFilters.FileName |
NotifyFilters.CreationTime |
NotifyFilters.LastWrite |
NotifyFilters.Size |
NotifyFilters.DirectoryName;

watch.EnableRaisingEvents = true;

The same problem occurs when I use any of the simpler sample apps from
visual studio MSDN eg public class Watcher from the
System.IO.FileSystemWatcher Class
My local Windows is XP service pack 3, and the same problem occurs on any
workstation.
 
Back
Top