Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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...

like image 925
JacobE Avatar asked Feb 17 '09 08:02

JacobE


People also ask

Which framework is used for dependency injection?

Spring.NET is one of the popular open source frameworks for Dependency Injection. Spring.NET supports . NET 4.0, . NET Client Profile 3.5 and 4.0, Silverlight 4.0 and 5.0, and Windows Phone 7.0 and 7.1.

Does .NET framework have dependency injection?

. NET supports the dependency injection (DI) software design pattern, which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies. Dependency injection in . NET is a built-in part of the framework, along with configuration, logging, and the options pattern.

Should I use transient or scoped?

Use Transient lifetime for the lightweight service with little or no state. Scoped services service is the better option when you want to maintain state within a request. Singletons are created only once and not destroyed until the end of the Application. Any memory leaks in these services will build up over time.

Which dependency injection is better in C#?

Constructor Injection in C# Construction injection is the most commonly used dependency pattern in Object Oriented Programming.


2 Answers

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

like image 83
Scott Muc Avatar answered Sep 28 '22 01:09

Scott Muc


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.

like image 22
Matt Hamilton Avatar answered Sep 28 '22 02:09

Matt Hamilton