我发现 .config-files 中的 configsource 引用非常有帮助。但是,由于这些引用的配置文件仅包含整个 app.config 层次结构的片段,IDE 会抱怨。
在 app.config 文件中:
<configuration>
<configSections>
<section name="customProfiles" type="SomeConfigClass, SomeAssembly"/>
</configSections>
</configuration>
(snip)
<valveProfiles configSource="Profiles.config" />
在 Profiles.config 中:
<customProfiles>
<curveProfile number="-1" name="Cusom1" />
</customProfiles>
但是,IDE 具有与模式关联Profiles.Config
的文件,该DotNetConfig.xsd
模式需要在 configSections 元素中声明“customProfiles”,而 Profiles.config 文件没有。
我对此并不特别感到困扰,因为它基本上只影响智能感知,并在您指向蓝色的下划线时产生误导性的工具提示,但我很惊讶谷歌对此一无所知。不,这不是因为我在搜索中包含了“undersquiggle”这个词;)