문제

I am using the following code from castle windsor documentation. I can't figure out how to pass in my configFile on my bootstrapper container installer that installs this installer.

 public void Install(IWindsorContainer container, IConfigurationStore store)
    {
        container.AddFacility<LoggingFacility>(f => f.UseLog4Net("NameOfConfigFile"));
    }
도움이 되었습니까?

해결책 2

The only way I have been able to do this is by newing up my installer and passing in the NameOfConfigFile and in the constructor of my installer setting a private instance field to this value.

_bootStrapContainer = new WindsorContainer().Install(new LoggerInstaller(configPath));

다른 팁

By default I believe it will use a logging.config on the root of the project. Do you still need to use something more customized than that?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top