I have many Winform(VB.Net) apps with a Local/Dev/QA/Prod environment setup. I would like to dynamically load environmental config information and access it as if it was in the app.config file using System.Configuration. I haven't found a good solution for this yet. Maybe I'm expecting too much and will have to manually deserialize the environmental config. I'm looking for ideas on how to implement this environmental config?
Here's a list of what I'd like:
- The environmental config is a file on the file system containing an XML structure(similar to the app.config).
- Dynamically load environmental config based on environment.
- Environmental config can contain connection strings and other settings. Multiple additional config files is acceptable.
- Use the built in System.Configuration calls to access the values. Basically I would like to avoid having to write a custom deserializer.
I would prefer not to use these options if possible:
- Using a configsource parameter in the app.config to point to an external config. This would need to be edited for each environment and it would override(I think) the section where it's set.
- Using a custom deserializer. I know this could be done and it may be the actual solution. It just seems that this should be solvable without doing this.
- Using System.Environment isn't practical since it reads/writes to the registry for system variables.