以前app.config中只有(appSettings)数据库连接,在后面加上log4net的配置之后,数据库连接报错:““DBUtility.DbHelperMySQL”的类型初始值设定项引发异常。”,而把log4net的配置放在 appSettings前面就没问题.原始app.config<?xml version="1.0" encoding="utf-8" ?><configuration> <configSections> <appSettings> <add key="ConStringEncrypt" value="false"/> <add key="ConnectionString" value="server=11.11.11.11;database=111;uid=root;pwd=111"/> </appSettings></configuration> log4net的两块 <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> </configSections> <log4net>......</lot4net> 这两块在appsettings上面不报错,下面报错。哪位牛牛能解释下?
添加回答
举报
0/150
提交
取消