导读:
近期对原来的项目工程添加了一个test project对原工程进行nunit测试,运行msbuild后报如下错误:
log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the and elements. The configuration section should look like:
经查找发现原工程NHibernate中使用了
private void InitSessionFactory()
{
Configuration cfg = new Configuration();
cfg.Configure();
log4net.Config.XmlConfigurator.Configure();
sessionFactory = cfg.BuildSessionFactory();
}
在test project的app.config中并未加入与原工程web.config的log4net配置,经加入
本文转自
http://darkjune.javaeye.com/admin/show/131924
近期对原来的项目工程添加了一个test project对原工程进行nunit测试,运行msbuild后报如下错误:
log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the and elements. The configuration section should look like:
经查找发现原工程NHibernate中使用了
private void InitSessionFactory()
{
Configuration cfg = new Configuration();
cfg.Configure();
log4net.Config.XmlConfigurator.Configure();
sessionFactory = cfg.BuildSessionFactory();
}
在test project的app.config中并未加入与原工程web.config的log4net配置,经加入
本文转自
http://darkjune.javaeye.com/admin/show/131924