views:

25

answers:

1

Is there any way to enumerate through all settings to get the values that have been loaded by the configuration manager? Maybe I'm being dense here, but I can't find a way to enumerate through the settings that are contained within a section group.

I have a WCF service which is a designed to allow the calling system to pass in request objects which define the operation to be performed on the server. The service loads assemblies dynamically at runtime (like a plug-in model) and determines which object can answer the request. I am looking for a way that I can send a request to "give me all your config info", and the service can return the loaded information. I'm interested in what has been loaded into memory and is being used vs. what values are specified in the actual config file (the config can be replaced without affected anything in memory until a restart).

There's a SettingLoaded event that I might be able to use to keep track of them, but this seems far-fetched.

Any ideas?

+1  A: 

Perhaps I'm misunderstanding your question, but to me the only settings that are guaranteed to be key/value pairs are the AppSettings, which you can get to via the ConfigurationManager.AppSettings property.

HTH,
Kent

Kent Boogaart
Fair enough, and you're right- that's pretty straightforward. I'm more thinking of settings that are stored in applicationSettings group. Inside the group, I can get the sections (per assembly), but I don't see any way to get the values that are loaded in memory. They are known to have <setting><value> format, but the loaded type is unknown of course.
joeg