WCF configuration files can sometimes be very, very long. Therefore it can be a good thing to separate out some of the sections. Here is a fast overview on how to do it.
Place sections in external file – example from BNRkre:
<system.serviceModel> <bindings configSource="bin\SystemServiceModelBindings.config"/> <client configSource="bin\SystemServiceModelClient.config"/> </system.serviceModel> </configuration>
If you wanted you could separate out your entire system.serviceModel section group into smaller files:
<configuration> <system.serviceModel> <services configSource="services.config"/> <bindings configSource="bindings.config"/> <behaviors configSource="behaviors.config"/> <extensions configSource="extensions.config"/> </system.serviceModel> </configuration>
Note, however, that you can only use this for sections. This technique can’t be used for the system.serviceModel section group or for any config elements. Also note that the referenced files should contain only one section, and that you won’t need a <configuration> or <system.serviceModel> tag in them, just the section being referenced.