I have some code that uses FileSystemWatcher to monitor file changes outside of my application.
On Windows 7, using .NET 4, the below code would detect when a file
There are too many comments everywhere, I will just add an answer to verify that you are aware of the following issues:
Apparently the problem is that the event is raised on a background thread, and you need to marshal the call back to the UI thread.
I have experienced a lot of trouble with the FileSystemWatcher class, and decided not to use it as you can see me describe here: https://stackoverflow.com/a/22768610/129130 . It is possible, however, that the problems I experienced were due to thread synchronization issues and / or hardware issues.