2010-12-11 155 views
0

我是新來的IOC和溫莎城堡。我想用的城堡按照他們提供的文件日誌工具註冊Castle Windsor日誌設施

http://stw.castleproject.org/Windsor.Logging-Facility.ashx

我想每個註冊的文檔推薦

container.AddFacility<LoggingFacility>(f => f.LogUsing(LoggerImplementation.Log4net).WithConfig("log4net.config")); 

我已經提到的Castle.Core和城堡設施.Facilities.Logging DLL的

在編譯時我得到以下錯誤

The type 'Castle.Facilities.Logging.LoggingFacility' cannot be used as type parameter 'T' in the generic type or method 'Castle.Windsor.IWindsorContainer.AddFacility<T>(System.Func<T,object>)'. 
There is no implicit reference conversion from 'Castle.Facilities.Logging.LoggingFacility' to 'Castle.MicroKernel.IFacility'. C:\Sports\app\Daedalsoft.Sports.ApplicationServices\WindsorServiceInstaller.cs 

任何幫助將不勝感激。

回答

3

它看起來像你可能有一個從以前的版本Castle.MicroKernel.dll的引用。 Castle.MicroKernel被合併到Castle.Windsor.dll中,如果你使用的是最新版本的Windsor,你不應該有Castle.MicroKernel.dll。

另外,還要確保你有Castle.Services.Logging.Log4netIntegration.dll參考,log4net.dll

+0

謝謝毛,這是它... – user351479 2010-12-12 16:38:35

相關問題