app.config配置问题?
<?xml version= "1.0 " encoding= "utf-8 " ?>
<configuration>
<!-- <appSettings>
<add key= "MySqlUID " value= "root "/>
<add key= "MySqlPwd " value= "123 "/>
</appSettings> -->
<configSections>
<section name= "MySql " type= "System.Configuration.NameValueSectionHandler "/>
</configSections>
<MySql>
<add key= "db " value= "System "/>
<add key= "uid " value= "root "/>
<add key= "pwd " value= "123 "/>
</MySql>
</configuration>
用分组配置出现了
未能找到元素“add”的架构信息
未能找到元素“key”的架构信息
------解决方案-------------------- <appSettings>
<add key= "MySqlUID " value= "root "/>
<add key= "MySqlPwd " value= "123 "/>
</appSettings>
这样呢?
------解决方案-------------------- <?xml version= "1.0 " encoding= "utf-8 " ?>
<configuration>
<appSettings>
<add key= "MySqlUID " value= "root "/>
<add key= "MySqlPwd " value= "123 "/>
</appSettings>
<configSections>
<section name= "MySql " type= "System.Configuration.NameValueSectionHandler "/>
</configSections>
<MySql>
<add key= "db " value= "System "/>
<add key= "uid " value= "root "/>
<add key= "pwd " value= "123 "/>
</MySql>
</configuration>
------解决方案-------------------- <!-- <appSettings>
<add key= "MySqlUID " value= "root "/>
<add key= "MySqlPwd " value= "123 "/>
</appSettings> -->
的註釋去掉!
<appSettings>
<add key= "MySqlUID " value= "root "/>
<add key= "MySqlPwd " value= "123 "/>
</appSettings>
就好了!