Which .NET dependency injection framework do you use? [closed]

耗尽温柔 提交于 2019-12-18 03:43:18

问题


Currently there are quite a few DI/IoC-frameworks for .NET out there (http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx). I find it quite hard to choose. Therefore I wanted to measure the public opinion and see which framework is the most popular - so please post your favorite framework here and let the people vote...


回答1:


I'm currently using Castle.Windsor. Mainly because of the integration it has with the Rhino Tools library.




回答2:


I've been watching Kzu (creator of Moq)'s screencast series as he develops Funq - a DI framework that makes extensive use of lambdas the same way Moq does. No release yet but I'm looking forward to trying it out.




回答3:


StructureMap

I love the fact that I can configure it all using the fluent interface (aka Configuration DSL). Typesafe configuration is a must when I do refactoring.




回答4:


Autofac. Type-safe and plays well with code-refactoring. Apart from the boiler-plate stuff, I found the delegate factories to be very useful.




回答5:


Use Windsor or Unity, and decide based on a POC

Unity is not so bloated up so far, you could go with that based on your project type - especially if you are using unity dependent frameworks like CompositeWPF

See another thread on SO about the same, Enterprise Library Unity vs Other IoC Containers




回答6:


Unity It's simple and unintrusive, yet type-safe. And it is created by Microsoft Pattern & Pratices group.




回答7:


Have a look at Structuremap which is a Dependency Injection / Inversion of Control tool for .Net



来源:https://stackoverflow.com/questions/555943/which-net-dependency-injection-framework-do-you-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!