I have a project where there are multiple applications that have some common configuration values. I would like to have a shared .config file that is available to all of the applications using the .Net configuration object model. Each application would also have its own app.config file
How can this best be done. I'd rather avoid using the registry as much as possible. In looking through the documentation, the OpenExeConfiguration(string exePath) method seems promising for accessing a specified config file. Is this a reasonable approach? Any other suggestions?
Step 1: Place the App. Config file in a folder parent to both(or all) the projects that needs to use the same Config file. I have put it in a new folder called AppConfig. Step 2: Right click on each project and select the same App.
You cannot use multiple configuration files (i.e. one per library project) without coding.
Some sections in the app.config allow for a reference to an external file.
<appSetting configSource="somefile.config"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With