title: Construtor/Setter Injection using IoC in HttpHandler, is it possible?
body: <p>I've ran into a rather hairy problem. There is probably a simple solution to this but I can't find it!</p>
  
  <p>I have a custom HttpHandler that I want to process a request, log certain info then enter the details in the database. I'm using NUnit and Castle Windsor.</p>
  
  <p>So I have two interfaces; one for logging the other for data entry, which are constructor injected. I quickly found out that there is no way to call the constructor as the default parameterless constructor is always called instead.</p>
  
  <p>So I thought I would use Setter injection and let Castle windsor sort it out. This actually works as when I use <code>container.Resolve&lt;CustomHttpHandler&gt;();</code> I can check that the logger is not null. (In Application_Start in Global.asax.cs)</p>
  
  <p>The problem is although Castle Windsor can create the instance the http application is not using it??? I think??</p>
  
  <p>Basically the whole reason for doing it this way was to be able to test the logger and data repository code in isolation via mocking and unit testing.</p>
  
  <p>Any ideas how I can go about solving this problem?</p>
  
  <p>Thanks!</p>