Reputation: 2652
I have a code snippet like this in my App.config -
<appSettings file="..\..\..\master_AppSettings.config">
<add key="ApplicationDSN" value="XYZConnectionString" />
</appSettings>
In the master_AppSettings.config file I have set "ApplicationDSN" as "ABCConnectionString". Now what I want is the following behavior - If "ApplicationDSN" is not again set in App.config then take the value from master_AppSettings.config file otherwise take the value from App.config. Basically, I want to override the value if it is present in App.config.
The problem is that the above scheme does not seem to work. The C# project is only taking the value from master_AppSettings.config and ignoring if mentioned in App.config.
So, how can I implement my scheme to work? Any help will be appreciated.
Thanks, Vaibhav
Upvotes: 3
Views: 840
Reputation: 7622
No can do. Because it is other way round. Mention all your base settings in App.config - whatever you want to override, put it in the external settings file. The external file overrides the App.config.
Upvotes: 2