configSource在system.serviceModel *或*的子节中不起作用 [英] configSource doesn't work in system.serviceModel *or* its subsections
问题描述
我尝试将app.config文件拆分为多个文件,以便更轻松地管理不同环境所需的差异。有些部分很容易...
I'm trying to split an app.config file into multiple files to make it easier to manage the differences needed for different environments. With some sections it was easy...
<system.diagnostics>
various stuff
</system.diagnostics>
成为
<system.diagnostics configSource="ConfigFiles\system.diagnostics.dev" />
。
但是对于 system.serviceModel
部分,这似乎不起作用。
But for the system.serviceModel
section this doesn't seem to work.
现在我已经阅读了建议,它不适用于 system.serviceModel
本身,但它适用于下面的部分: bindings
, client
, diagnostics
等等。使用configSource与其中之一。当我放入
Now I've read suggestions that it doesn't work for system.serviceModel
itself, but it works for the sections underneath it: bindings
, client
, diagnostics
, etc. But the same thing happens to me when I try to use configSource with one of them. When I put in
<system.serviceModel>
<bindings configSource="ConfigFiles\whateverFile.dev" />
我得到:
未声明configSource属性。
有没有其他人看过?你知道一个解决方案吗? (也许我有一个过时的模式或者什么?)
Has anyone else seen this? Do you know a solution? (Perhaps I have an out-of-date schema or something?)
推荐答案
VS.NET的编辑器关于配置,它会工作。
VS.NET's editor moans about the config, but it works.
我有这样的配置...
I have config like this...
<system.serviceModel>
<behaviors configSource="config\system.servicemodel.behaviors.config" />
<bindings configSource="config\system.servicemodel.bindings.config" />
<client configSource="config\system.servicemodel.client.config" />
</system.serviceModel>
...效果很好。
这篇关于configSource在system.serviceModel *或*的子节中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!