I'm working with FilesysteWatcher in the .net framework for some time, and they are pretty straightforward. Something though is happening that I cannot understand. I'm implementing something really simple to monitor a folder for XML files.
Once I get one, I get the file, I read it and I start doing things. Pretty simple. Everything works as long as I don't drop too many files at once. As long as I drop <15-20, everything works, if I go over, the first one is managed (I see the event fired), but after that, the only way to receive events again is to kill the process, and restart it.
Did I miss something obvious? This is how I instantiate my watcher:
fsw = new FileSystemWatcher(sourcePath, "*.xml")
{
EnableRaisingEvents = true
};
fsw.NotifyFilter =NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName;
fsw.Created += OnCreated;
fsw.IncludeSubdirectories = false;
fsw.InternalBufferSize = 64000;
Thanks,