Configuration changes but new reading is not correct

Topics: Enterprise Library Core, Pre-release discussions
Jun 1, 2007 at 7:42 AM
Hi all,
I met a problem when using configuration interfaces of EL2.
After I use the IConfigurationSource succesfully updated one section of my config file, the changes were made immediately but the next reading of that section doesn't change until 5 seconds later. I've checked the config file and I'm sure it was modified right after I excecuted the update,But the next reading to it still returned the old data .And it returned the updated data if I waited 5 seconds or so.
Is there anybody know how to read the updated data right after I updated the config file? Thank you.
Jun 1, 2007 at 5:52 PM
If your application is that sensitive to changes in the configuration, you may need to re-think your strategy of a file-based configuration as well as relying on change notification events.

You might look at the SqlConfigurationSource example in the QuickStarts. You could also create your own IConfigurationSource that polls to see if there was a change in configuration as oppose to relying on events.




David Hayden
Microsoft MVP C#
Jun 2, 2007 at 3:03 AM
Edited Jun 2, 2007 at 3:05 AM
Yeah, actually I've been considering using the change notification events first. What I need to do next it go deep inside the infrustructure to see what happens to the reading, it seems to have used some caching mechanism.
Thank you Dave.