FileSystemWatcher delete network file raises too many events error

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.
 

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

Similar Threads


Top