1

Is there any way using Castle Windor to constuct a HttpHandler in .net so that I can inject dependencies into it?

I realise this is a pretty sparse question, but I'm not sure what else to add. I have an implementation of IHttpHandler and I want to be able to inject dependencies into it, but I can't see how to get the IoC container to take over the instantiation of the handler, as it's done by the application on request.

Glenn Slaven
  • 33,720
  • 26
  • 113
  • 165
  • 1
    take a look to http://stackoverflow.com/questions/5384355/castle-windsor-and-ihttphandler-and-ihttphandlerfactory – Crixo Sep 05 '12 at 07:21

1 Answers1

2

When you say instantiation is "done by the application on request". Your application? Wouldn't you "just" change it to ask Castle Windsor for the handler? Or, do you mean it's instantiated via ASP.Net config?

Do you need a Custom HTTP Handler Factory to handle handling of your handler? http://msdn.microsoft.com/en-us/library/ms227439(v=vs.100).aspx

Ivan Hamilton
  • 3,205
  • 1
  • 23
  • 14