I am using a FileSystemWatcher
on a directory and added its event handlers, set its EnableRaisingEvents=true;
and IncludeSubdirectories=false;
and added NotifyFilters
.
While running the application if I create new folders in the specified directory sometime I get
FileNotFoundException : "An error occurred while reading a directory". System.IO.FileSystemWatcher.StartRaisingEvents() System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
What can be root cause of the problem?
What is StartRaisingEvents()
?