2010-12-11 96 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