我想将文件的某些部分保留web.config在 web.config 文件之外。所以我正在使用该configSource属性并引用其他一些文件。当我在文件中添加多个配置时web.config,VS 2010 显示红色波浪线表示Only one tag allowed at root level。
是否需要为使用属性.config的 web.config 文件的每个配置部分设置单独的文件?configSource如果没有,如何摆脱上述VS2010投诉?
web.config 中的相关部分如下:
<MyApplication.Configuration file="Configuration\customAppConfiguration.config" />
<system.diagnostics configSource="Configuration\customAppConfiguration.config" />
该customAppConfiguration.config文件如下所示:
<?xml version="1.0"?>
<MyApplication.Configuration>
<!-- Contains My Application's configuration -->
</MyApplication.Configuration>
<system.diagnostics>
<!-- Diadnostic's configuration -->
</system.diagnostics>