Use the following in the default web. config file of the site:
<Etetaskconfigsource = "My. config"/>
Create the my. config file:
<? XML version = "1.0" encoding = "UTF-8"?> <Appsettings> <add key = "test" value = "Hello world."/> </appsettings>
In. NET Framework 2.0, you can configure all configuration elements that support the configsource attribute in a single file. However, when the configsource attribute is used, you must move the entire section to a separate file because there is no combination of element settings. When the configsource attribute is used, a write operation is performed on the Web. config file. This will cause the application to restart, but the subsequent updates to this section will directly write a separate file, without causing the subsequent application to restart.
Can contain only configsource once;
When the website is running, modifying the Web. config file will cause the site to restart, but not modifying the my. config file, which also improves the readability of the configuration file.