configSource不能在system.serviceModel工作*或*的小节能在、小节、工作、configSource

2023-09-02 12:02:33 作者:爱过吗只是睡吧

我试图分裂一个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="ConfigFilessystem.diagnostics.dev" />

与各种各样的东西移动到system.diagnostics.dev文件。

with the "various stuff" moved to the system.diagnostics.dev file.

但对于 system.serviceModel 部分这似乎并没有工作。

But for the system.serviceModel section this doesn't seem to work.

现在我读过的建议,它并没有为 system.serviceModel 作品本身,但它的部分它的下面:绑定客户端诊断等,但同样的事情发生在我身上时,我尝试使用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="ConfigFileswhateverFile.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="configsystem.servicemodel.behaviors.config" />
    <bindings configSource="configsystem.servicemodel.bindings.config" />
    <client configSource="configsystem.servicemodel.client.config" />
  </system.serviceModel>

......,工作正常。

... which works fine.