使用VS2010
我在我的web.config文件中有以下内容(细节已删除)。
<system.serviceModel>
<behaviors />
<services />
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<bindings />
<client />
</system.serviceModel>
我希望能像appSettings一样使用configSource属性,从另一个配置文件中获取这些元素的详细信息。
我已经尝试将configSource属性应用于system.serviceModel或每个子节点中的任何一个,但是我收到了无效的蓝色波浪线,并显示:
The 'configSource' attribute is not allowed
我参考了这个问题中的第二个答案(Tom Brothers提供),它演示了我想要的内容。
能否从外部xml文件读取web.config?
附加信息
这是该帖子中的配置。具有无效的蓝色波浪线。
<connectionStrings configSource="web\config\connectionStrings.config" />
<appSettings configSource="web\config\appSettings.config" />
<system.diagnostics configSource="web\config\diagnostics.config" />
<system.serviceModel>
<bindings configSource="web\config\serviceModelBindings.config" />
<behaviors configSource="web\config\serviceModelBehaviors.config" />
<services configSource="web\config\serviceModelServices.config" />
<client configSource="web\config\serviceModelClient.config" />
</system.serviceModel>
在这种情况下,我该如何使用configSource属性?