The watchers had FileSystem set to the MountFileSystem and removal was checking for the internal IFileSystem being watched. Those are never going to be the same so the instances were never removed.
I noticed this when I had a PhysicalFileSystem mounted, watched the MountFileSystem, then remove (and dispose) the physical FS instance. When the watcher picks something up it'll throw an ObjectDisposedException trying to use the PhysicalFileSystem instance.
I also moved the removal (and disposal) of those FSWs to happen before FS disposal could happen to avoid a similar disposal issue.
Thanks! (Glad that you are using it! as I don't have the time for my own project, so it's difficult to evaluate how much the library is reliable on this)
The watchers had
FileSystem
set to theMountFileSystem
and removal was checking for the internalIFileSystem
being watched. Those are never going to be the same so the instances were never removed.I noticed this when I had a
PhysicalFileSystem
mounted, watched theMountFileSystem
, then remove (and dispose) the physical FS instance. When the watcher picks something up it'll throw anObjectDisposedException
trying to use thePhysicalFileSystem
instance.I also moved the removal (and disposal) of those FSWs to happen before FS disposal could happen to avoid a similar disposal issue.