You can use the configSource
attribute to tell the framework to load a particular section from another file.
For example, if you had a config file with a section like this:
<connectionStrings>
<add name="MyDatabase" connectionString="...etc..." />
</connectionStrings>
You could replace it with:
<connectionStrings configSource="ConnectionStrings.config" />
...and create a file ConnectionStrings.config
with the contents of the original section (including the <connectionStrings>
node - exactly the same as my first code section above).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…