0

I am new to IOC and Castle Windsor. I would like to use the logging facility provided by Castle per their documentation

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

I am trying to register the facility per the documentation recommendation

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

I have referenced the Castle.Core and Castle.Facilities.Logging dll's

at compile time I get the following error

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

Any help would be much appreciated.

1 Answer 1

3

It looks like you may have a reference to Castle.MicroKernel.dll from a previous version. Castle.MicroKernel was merged into Castle.Windsor.dll, if you're using the latest version of Windsor you shouldn't have Castle.MicroKernel.dll.

Also make sure you have a reference to Castle.Services.Logging.Log4netIntegration.dll and log4net.dll

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.