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

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

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>

 

posted @ 2014-08-15 20:01    阅读(2385)  评论(0编辑  收藏  举报