首页 > 代码库 > 读取配置文件异常,配置系统未能初始化

读取配置文件异常,配置系统未能初始化

异常原因:配置文件内容的顺序有一定要求

configSections-->connectionStrings-->appSettings  
<?xml version="1.0" encoding="utf-8"?><configuration>  <configSections>    <section name="WebConfigSection" type="MediaActionServer.WebConfigSection, MediaActionServer"/>  </configSections>  <connectionStrings>    <add name="backgroundEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\sqlexpress;Initial Catalog=background;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />  </connectionStrings>  <WebConfigSection WebName="占占网站" DoMain="www.zhanzhan.com"  />  <appSettings>    <add key="site" value="www.zzl.com"/>  </appSettings></configuration>