首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

在读取 app.config文件时 报配置系统未能初始化,请高手指导上

2012-10-17 
在读取 app.config文件时 报配置系统未能初始化,请高手指导下XML code?xml version1.0?配置如下conf

在读取 app.config文件时 报配置系统未能初始化,请高手指导下

XML code
<?xml version="1.0"?>配置如下<configuration>  <configSections>    <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>  </configSections>  <startup>    <supportedRuntime version="v2.0.50727"/>  </startup>  <connectionStrings>    <add name="EquipmentsManagement" connectionString="Data Source=192.168.0.146;Initial Catalog=equipmenttest;Persist Security Info=True;User ID=equpment;Password=eqtest" providerName="System.Data.SqlClient"/>  </connectionStrings>  <log4net>    <root>      <level value="All"/>      <appender-ref ref="RollingFileAppender"/>    </root>    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">      <param name="File" value="log\equiepment.Log"/>      <param name="AppendToFile" value="true"/>      <param name="MaxSizeRollBackups" value="10"/>      <param name="MaximumFileSize" value="10MB"/>      <param name="RollingStyle" value="Size"/>      <param name="StaticLogFileName" value="true"/>      <layout type="log4net.Layout.PatternLayout">        <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n"/>      </layout>    </appender>  </log4net></configuration>


[解决办法]
XML code
<configuration>  <appSettings/>  <configSections>    <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>  </configSections>  <startup>    <supportedRuntime version="v2.0.50727"/>  </startup>  <connectionStrings>    <add name="EquipmentsManagement" connectionString="Data Source=192.168.0.146;Initial Catalog=equipmenttest;Persist Security Info=True;User ID=equpment;Password=eqtest" providerName="System.Data.SqlClient"/>  </connectionStrings>  <log4net>    <root>      <level value="All"/>      <appender-ref ref="RollingFileAppender"/>    </root>    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">      <param name="File" value="log\equiepment.Log"/>      <param name="AppendToFile" value="true"/>      <param name="MaxSizeRollBackups" value="10"/>      <param name="MaximumFileSize" value="10MB"/>      <param name="RollingStyle" value="Size"/>      <param name="StaticLogFileName" value="true"/>      <layout type="log4net.Layout.PatternLayout">        <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n"/>      </layout>    </appender>  </log4net></configuration> 

热点排行