I have an application where I am looking for a text file and if there are any changes made to the file I am using the OnChanged eventhandler to handle the event
OnChanged
Here is my solution which helped me to stop the event being raised twice:
watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.Size;
Here I have set the NotifyFilter property with only Filename and size. watcher is my object of FileSystemWatcher. Hope this will help.
NotifyFilter
watcher