'NHibernate.LoggerProvider'的类型初始值设定项引发了异常

use*_*732 8 nhibernate common.logging

我正在尝试使用Common.Logging程序集来替换默认的nHibernate Log4net日志记录.

我在我的项目中添加了一个引用:
Common.Logging.dll v2.0
NHibernate.Logging.CommonLogging.dll v1.2.0.4000

,然后将以下内容添加到我的Web.config中:

<add key="nhibernate-logger" value="NHibernate.Logging.CommonLogging.CommonLoggingLoggerFactory, Hibernate.Logging.CommonLogging"/>
Run Code Online (Sandbox Code Playgroud)

我的目标是用Enterprise Library 5.0替换Log4net日志记录,但我现在只是一步一步.

当我现在运行我的应用程序时,我得到以下异常:

The type initializer for 'NHibernate.Cfg.Configuration' threw an exception. =>
The type initializer for 'NHibernate.LoggerProvider' threw an exception. =>
The type initializer for 'NHibernate.LoggerProvider' threw an exception. =>
Unable to instantiate: =>
Value cannot be null.\r\nParameter name: type
 at NHibernate.LoggerProvider.LoggerFor(Type type)
 at NHibernate.Cfg.Configuration..cctor()
Run Code Online (Sandbox Code Playgroud)

有没有什么我缺少使用Common.Logging与nHibernate?我已经尝试按照我在网上找到的说明但是它无法正常工作,我找不到解决方案:(

我正在使用NHibernate v3.2.0.4000.

PS.这是我在这个网站上的第一篇文章很抱歉如果格式不对,我会接受建设性的批评:o)

Fir*_*iro 8

切换Hibernate.Logging.CommonLoggingÑ Hibernate.Logging.CommonLogging