How to share configuration settings between multiple applications

I have a project in which there are several applications that have some common configuration values. I would like to have a common .config file that is accessible to all applications using the .Net configuration object model. Each application also has its own app.config file.

What is the best way to do this? I would prefer not to use the registry as much as possible. When viewing the documentation, the OpenExeConfiguration (string exePath) method seems promising for accessing the specified configuration file. Is this a smart approach? Any other suggestions?

+6
configuration-files
source share
3 answers

Here is a discussion that discusses OpenExeConfiguration, which may be useful.

+1
source share

Some sections in app.config allow you to reference an external file.

<appSetting configSource="somefile.config"/> 
+5
source share

I would put the value in the machine configuration. Then you can override any value that you need by placing it in the configuration of a separate application.

+2
source share

All Articles