我有一个使用C#在VS2010中编写的Windows窗体应用程序,并在app.config文件中获得以下错误:
Message 4 Could not find schema information for the attribute 'name'
Message 8 Could not find schema information for the attribute 'name'
Message 12 Could not find schema information for the attribute 'name'
Message 5 Could not find schema information for the attribute 'serializeAs'
Message 15 Could not find schema information for the element 'CCP_Utility.Settings1'
Message 2 Could not find schema information for the element 'CCP_Utility.Properties.Settings'
Message 3 Could not find schema information for the element 'setting' …Run Code Online (Sandbox Code Playgroud) 我的app.config文件中有一个与我们的IoC容器类相关的自定义部分.在编辑本节的配置文件时,如何获取intellisense,以及摆脱编译器消息,通知我缺少的模式.
我在这里找到了这个问题:app.config configSections自定义设置无法找到架构信息,但我不明白它是否适用于我的问题,以及如果有的话如何使用答案.
我还找到了这个页面如何在Visual Studio .NET中获取Web.config和App.config的Intellisense,但它说在运行应用程序之前删除了xmlns属性.这真的是唯一/最好的方式吗?
以下是一个简单文件的示例:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="ServiceContainers"
type="LVK.IoC.RegistrationsSectionHandler, LVK"/>
</configSections>
<ServiceContainers>
<Registration type="DatabaseConnection" class="DatabaseConnection">
<Parameter name="connectionString" type="System.String"
value="TYPE=MSSQL2000;SERVER=localhost;DATABASE=db"/>
</Registration>
</ServiceContainers>
</configuration>
Run Code Online (Sandbox Code Playgroud)
基本上我希望能够<R在<ServiceContainers>节点内输入,并在intellisense下拉列表中向我建议注册,以及它的相应属性.