WCF Configuration - Split it out of app.config

前端 未结 8 1609
耶瑟儿~
耶瑟儿~ 2020-12-10 02:38

I have a specific requirement to remove all client WCF configuration () out of the main app.config file, and into a separate XML file. The behav

相关标签:
8条回答
  • 2020-12-10 03:13

    You can separate out your WCF configuration using configSource. Instructions here:

    http://weblogs.asp.net/cibrax/archive/2007/07/24/configsource-attribute-on-system-servicemodel-section.aspx

    Another option is to configure your WCF services programatically.

    0 讨论(0)
  • 2020-12-10 03:14

    System.ServiceModel.Configuration.ConfigurationChannelFactory et al support reading the configuration from a System.Configuration.Configuration instance. Which means you can put the <system.servicemodel ... stuff in a dedicated file without referencing it from web/app.config. You could have multiple config files, one for each client.

    SharePoint 2010 uses that excessively in its service application model, where each service proxy reads its settings from a dedicated .config which is not necessarily web.config or app.config and isn't even referenced from there.

    0 讨论(0)
提交回复
热议问题