We have lot of configuration files used in our application. Atleast 100 different xml files for each customer containing at least 50-80 name/value pairs of configuration and all they are often change (atleast every month).
The configuration file looks something similar like below,
<property id="url" value="s123"/>
<property id="input-element-name" value="name" />
<property id="input-element-xpath" value="//body;//form;//table[3];" />
Currently to read this values from xml file we use XmlReader et al and store it in a cache once the application starts (and this could be huge tomorrow when our customer base increases). To access the property ids we have created const variables in a static class to avoid typo etc.,
This approach was great when we had less configurations. Now, it is painful to maintain and add any new to this configuration file. Need to do rebuild etc., just kills the concept of keeping configurable values outside code.
I was just wondering if any recent developments in .NET space such as M language, IronPython could help here to have dynamically typed and compiled configuration values on demand when configuration file gets changed. We don't have any reservations in having xml format for configuration.
In summary, what I need is to have some .XXX files having our configuration values and if anything is changed or added that should be automatically compiled and can be used in our application without creating constants etc., I know something similar happens with .T files in VS.
I hope this could be doable ..
UPDATE
The idea of this question was not seems to be understood correctly or I wouldn't have spelled out correctly. Sorry for the trouble.
The custom configuration section may not appropriate for this problem, the reason is using ConfigurationSection
requires code modification if I add any new name/value pair. However, this approach will work if only change values as name part is being mapped to property in the code.
I was wondering if i use any dynamic language breeds such as IronPython or M Language I could be able to move all XML to it and in my application I would able to see any changes to this file (using `FileSystemWatcher') and execute it to read the newly added configuration name/value pairs.