title: Using Windsor Castle IoC for Windows service
body: <p>I'm writing the Windows service Listner for Active MQ. I'm trying to implement Dependency Injection in the project. But i'm not sure where to register Container and how it will be resolved ? </p>
  
  <p>I tried to put it in OnStart method as below, but no luck.</p>
  
  <pre><code> protected override void OnStart(string[] args)
          {
              container = new WindsorContainer();
              //  IWindsorContainer container = new WindsorContainer();
              //container.Install(FromAssembly.This());
              container.Register(
                  Component.For&lt;IHttpClientProxyHandler&gt;().ImplementedBy&lt;HttpClientProxyHandlerWeb&gt;().LifestyleTransient(),
                  Component.For&lt;IHttpClientProxy&gt;().ImplementedBy&lt;HttpClientProxyWeb&gt;().LifestyleTransient(),
                  //Component.For&lt;IRedisCacheClient&gt;().ImplementedBy&lt;RedisCacheClient&gt;().LifestyleTransient(),
                  Component.For&lt;IApplicationSettings&gt;().ImplementedBy&lt;ApplicationSettings&gt;().LifeStyle.PerWebRequest,
  
                  Component.For&lt;ILogger&gt;().ImplementedBy&lt;Logger&gt;().LifeStyle.PerWebRequest
  
              );
  
  
              this.messagingQueue = new ActiveMessagingQueue(new ApplicationSettings(), new Logger());
              this.logger = new Logger();
              this.applicationSettings = new ApplicationSettings();
              this.httpClientProxyHandler = container.Resolve&lt;IHttpClientProxyHandler&gt;();
  
              this.messagingQueue.OnMessageReceived += this.OnListenerMessage;
          }
  </code></pre>
  
  <p>Then i tried to put in  ServiceBase Constructor- no luck . Even tried putting it in Main function. But im getting below error always in event logger.</p>
  
  <p><strong>'Namespace.HttpClient.HttpClientProxyHandler' is waiting for the following dependencies:
  - Service 'Castle.Windsor.IWindsorContainer' which was not registered.</strong></p>
  
  <p>Can anyone help here?</p>