IDE 抱怨 ConfigSource 属性中引用的配置文件不符合 DotNetConfig.xsd
我发现 .config 文件中的配置源引用非常有帮助。 但是,由于这些引用的配置文件仅包含整个 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
架构关联起来,该架构需要“customProfiles”要在 configSections 元素中声明,而 Profiles.config 文件没有该元素。
我对此并没有特别困扰,因为它基本上只影响智能感知,并在您指向蓝色下划线时生成误导性的工具提示,但令我惊讶的是谷歌在这方面完全是空的。 不,这并不是因为我在搜索中包含了“undersquiggle”这个词;)
I find configsource references in the .config-files to be very helpful. However, since these referenced config-files only contain fragments of the entire app.config hierarchy, the IDE complains.
In the app.config file:
<configuration>
<configSections>
<section name="customProfiles" type="SomeConfigClass, SomeAssembly"/>
</configSections>
</configuration>
(snip)
<valveProfiles configSource="Profiles.config" />
in the Profiles.config:
<customProfiles>
<curveProfile number="-1" name="Cusom1" />
</customProfiles>
However, the IDE has associated Profiles.Config
file with the DotNetConfig.xsd
schema, which expects the "customProfiles" to be declared in the configSections element, which the Profiles.config file does not have.
I am not particularily bothered by this as it basically only affects intellisense and generates misleading tooltips when you point at the blue undersquiggle, but I was surprised that google came up absolutely empty on this. And no, it is not because I included the word "undersquiggle" in my search ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论