IoC依赖注入自定义HTTP模块 - 怎么样? (ASP.NET) [英] IoC Dependency injection into Custom HTTP Module - how? (ASP.NET)
本文介绍了IoC依赖注入自定义HTTP模块 - 怎么样? (ASP.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果您需要特定的IoC容器 - 我目前正在使用Windsor,但很快就会转到AutoFac。
谢谢
解决方案
我只是在我的博客上回答了这个问题。
还 http://lozanotek.com/blog/archive/2009/08 /19/Autowire_IHttpModules_with_IoC.aspx
I have a custom HTTP Module. I would like to inject the logger using my IoC framework, so I can log errors in the module. However, of course I don't get a constructor, so can't inject it into that. What's the best way to go about this?
If you need the specific IoC container - I'm currently using Windsor, but may soon move to AutoFac.
Thanks
解决方案
I just answered this question on my blog.
See also http://lozanotek.com/blog/archive/2009/08/19/Autowire_IHttpModules_with_IoC.aspx
这篇关于IoC依赖注入自定义HTTP模块 - 怎么样? (ASP.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文