I´m writing on an service to watch for the existence different files in diffent folders…
I´m using filesystemwatchers to get the events.
As a part of the deployment one of the watched folders is deleted and new created from time to time.
As a result the service throws an error and is stopped…
Is it possible to catch that kind of error and recreate the filewatcher on the new folder by the service?
Catch the deleted event, and then reschedule with timed poll to watch a new one?
I don’t have a compiler to hand right now but I knocked up this pseudo code: