config files can include external files.
If you'd put the endpoint's config onto an external file, and then include it in yout host, you won't need to change the host's config every time
eg:
in your app.config file:
...
<configSections>
...
<section name="myEndpoint" type="System.Configuration.DictionarySectionHandler" />
...
</configSections>
...
<myEndpoint configSource="myEndpoint.config" />
then myEndpoint.config could look like that:
<?xml version="1.0" encoding="utf-8"?>
<myEndpoint>
<add key="myKey" value="myValue" />
</myEndpoint>
and you can access the values from your code, similarly to reading normal app settings, like that:
var myEndpointConfig = (Hashtable)ConfigurationManager.GetSection("myEndpoint");
Console.WriteLine(myEndpointConfig["myKey"]);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…