Can I split system.serviceModel into a separate .config file?

允我心安 提交于 2019-11-30 08:09:21

You cannot "externalize" the <system.serviceModel> section group - since it's a configuration section group - but you can definitely externalize each of the bits inside it:

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

In the .NET configuration system, any configuration section can be externalized - each configuration section has a configSource attribute (even though Visual Studio sometimes complains and claims the contrary.....) - but not configuration section groups.

Unfortunately, these two are hard to tell apart - you need to consult the MSDN library or documentation to find out.

You should also check out Jon Rista's three-part series on the .NET configuration system up on CodeProject.

Highly recommended, well written and extremely helpful!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!