Search code examples
wcfbindingconfigconfigsectionconfigsource

How to use multiple locations for configSource in config file for WCF Client


Our application will act as client for different WCF-services in the future. At the moment we consume only one WCF-Service. Our config-file for the application is set up using configSource-attribues at the moment:

<configuration>
  <system.serviceModel>
    <services configSource="services.config"/>
    <bindings configSource="bindings.config"/>
    <behaviors configSource="behaviors.config"/>
    <extensions configSource="extensions.config"/>
  </system.serviceModel>
</configuration>

Is there a way to use multiple files for e.g. the bindings section? We would like to have each binding for a particular WCF-service that we consume in one file. So we would need to point the bindings section to multiple configSources.

Any help would be great.


Solution

  • Looks like you can't separate the configsections into different physical files. So we ended up merging e.g. all bindings in one file.