Is there a limit to the number of FileWatchers
supported by .NET, whether it be best performance practice or an actual windows limit?
I'm using the .NET MemoryCache class to cache of a library of some 15 000 small files. Each time a file is accessed, it's cached and I understand that the .NET MemoryCache
(via CacheItemPolicy.ChangeMonitors
) will create some sort of file watcher on it...
More info on the HostFileChangeMonitor created
When the HostFileChangeMonitor class is used in a non-ASP.NET application, the FileSystemWatcher class is used internally to monitor files. As a result, whatever access control list (ACL) applies to a monitored file or directory is applied to the Windows identity of the current thread.