what I'm trying to do is for my App.config file. I have many settings, and I want to split my configuration file into different files. For example; my app.config file has email-related settings, so I want to extract these settings and save them in the email.config file and then use the configSource attribute in my app.config file to add the thos settings from the email file. config file and add it to the node application settings. Is it possible?
If so, consult on how to achieve the above result.
Many thanks.
so for example, I have another configuration file called app1.config and has the following xml:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings > <add key="l" value="test"/> </appSettings> </configuration>
and then from my main app.config file they refer to the app1.config file, and then from the code you can do this to get the value of the application installation key:
var x = ConfigurationManager.AppSettings["l"];
johnnie
source share