我正在嘗試使用Common.Logging程序集來替換默認的nHibernate Log4net日誌記錄。「NHibernate.LoggerProvider」的類型初始值設定項引發異常
我說在我的項目的參考:
Common.Logging.dll 2.0
NHibernate.Logging.CommonLogging.dll v1.2.0.4000
,然後添加以下到我的web.config :
<add key="nhibernate-logger" value="NHibernate.Logging.CommonLogging.CommonLoggingLoggerFactory, Hibernate.Logging.CommonLogging"/>
我ulitmate目標是與企業庫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()
有什麼,我缺少使用與NHibernate的Common.Logging?我試過之後,我在網上找到的指示,但它不工作和
我使用NHibernate v3.2.0.4000我無法找到一個解決辦法:(。
PS。這是我在這個網站很抱歉,如果格式是不正確的第一個職位,我會glady接受建設性的批評:O)
我希望這個問題得到解答。這是我遇到的同樣的確切問題 – Mario
這是回答,只是他沒有標記。其中一個一次性帳戶,只是想問一個問題。基本上,配置字符串是從教程中複製的,它有一個錯字。 '「,Hibernate.Logging。」'。它應該是'NHibernate.Logging' –