【发布时间】:2012-03-28 22:23:20
【问题描述】:
我正在使用 Visual Studio 2005,并使用“App.config”文件创建了一个应用程序。 当我尝试编辑并向该 App.config 文件添加新值时,它显示错误请帮助我..
我的 app.config 文件包含:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="keyvalue" value="value"/>
<add key="keyvalue1" value="value1"/>
</appSettings>
<mySettings>
<add name="myname" myvalue="value1"/>
</mySettings>
</configuration>
显示错误为:
Could not find schema information for the element "mySettings"
Could not find schema information for the element "add"
Could not find schema information for the element "myvalue"
【问题讨论】:
-
请注意,这些“错误”只是信息性消息。 Visual Studio 只是让您知道,如果这些值应该是元素、属性、应该存储的类型,它就无法解决。忽略这些是安全的,但提供的答案为如何实现读取这些自定义值提供了指导。
标签: c# configuration custom-configuration