我刚开始使用NHibernate,我正在使用快速入门指南,但我一直收到这个错误。我完全按照快速入门指南的说法完成了所有操作,每次都会出现此错误。
<error>
{"The type initializer for 'NHibernate.Cfg.Configuration' threw an exception."}
</error>
此行发生错误:
Configuration nhConfig = new Configuration();
内部异常为:
<Inner Exception>
{"The type initializer for 'log4net.spi.LoggerManager' threw an exception."}
</Inner Exception>
内部异常的堆栈跟踪:
<Stack Trace>
" at log4net.spi.LoggerManager.GetLogger(Assembly domainAssembly, String name)\r\n at log4net.LogManager.GetLogger(Assembly domainAssembly, String name)\r\n at log4net.LogManager.GetLogger(Type type)\r\n at NHibernate.Cfg.Configuration..cctor()"
</Stack Trace>
答案 0 :(得分:0)
“这几乎看起来像一个log4net异常.Log4net也不应该在其程序集之外抛出任何异常。”