我刚刚开始使用 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>