I'm working on an open source where I need to populate a dictionary from reading values from multiple xml files and whenever any of the xml file changes I have to update the dictionary. Since there are multiple files I thought of using FileSystemWatcher. Is this a good idea? or I've to go with ASP.NET cache with file dependency? I'm not sure how ASP.NET cache helps me in the case of multiple files.
Note: I've implemented a locking mechainsm while updating the dictionary so threading won't be an issue in the case of updating dictionary.
FileSystemWatcheris not easy to work with. Whenever I've tried to use it I've ended up using a timer to scan the directory for updated files instead. That is much more reliable.