C# IDE抱怨ConfigSource属性中引用的配置文件不符合DotNetConfig.xsd
我发现.config文件中的configsource引用非常有用。但是,由于这些引用的配置文件只包含整个app.config层次结构的片段,IDE会抱怨 在app.config文件中:C# IDE抱怨ConfigSource属性中引用的配置文件不符合DotNetConfig.xsd,c#,visual-studio-2008,xsd,app-config,configuration-files,C#,Visual Studio 2008,Xsd,App Config,Configuration Files,我发现.config文件中的configsource引用非常有用。但是,由于这些引用的配置文件只包含整个app.config层次结构的片段,IDE会抱怨 在app.config文件中: <configuration> <configSections> <section name="customProfiles" type="SomeConfigClass, SomeAssembly"/> </configSection
<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文件没有
我对此并不感到特别的困扰,因为它基本上只会影响intellisense,当你指向蓝色的下标时,会产生误导性的工具提示,但我很惊讶谷歌在这一点上完全是空的。不,这并不是因为我在搜索中包含了“undersquiggle”一词;) 如果有人还在查看,VS2008不会为自定义配置导入XSD扩展。如果您使用自定义配置,您将收到模式警告,唉,还有欠精确。