Which Dependency Injection Framework?

I'm in the planning phase of a new ASP.NET project.  Currently I'm evaluating the various software components and packages I'm going to use to put this project together.  With all of the hype surrounding Dependency Injection, I've decided to give it a try in this new project.  The two most popular frameworks for DI, as far as I can tell, are Spring.NET and StructureMap.

I'm leaning towards Spring.NET simply because it offers so much more besides DI.  I can, however, appreciate the XML-less features present in StructureMap 2.0.  I'm not sure whether that feature is important enough to choose StructureMap over another offering.

I'm hoping the ASP.NET community can lend some advice as to which framework to use.  Of all of the available options, which would you choose and why?

Published Thursday, February 07, 2008 1:16 PM by CompiledMonkey

Comments

# Which Dependency Injection Framework? - Chris Stewart's ASP.NET Blog

Pingback from  Which Dependency Injection Framework? - Chris Stewart's ASP.NET Blog

# re: Which Dependency Injection Framework?

Thursday, February 07, 2008 1:47 PM by gianluca gravina

It seems you've missed one Big "competitor" Windsor Container, I think it's the most used nowadays !

GG

# re: Which Dependency Injection Framework?

Thursday, February 07, 2008 2:50 PM by Jan Van Ryswyck

I agree on Castle Windsor. Its really sweet and very easy to use with lots of features. If you don't like  XML configuration, you can use Ayende's Castle Binsor. If you want to get up to speed very quickly, these articles will help you:

blog.bittercoder.com/CategoryView,category,castle.aspx

If you make a choice between StructureMap, Spring.NET or Castle Windsor, I think its more of a personal preference. These frameworks are all very good and very feature-rich, so can't loose when choosing one of these three.

# re: Which Dependency Injection Framework?

Thursday, February 07, 2008 3:08 PM by Chris Canal

I use Castle personally and have found it fantastic.  I also use Castle for unit testing in the shape of an AutoMockingContainer (blog.eleutian.com/.../UsingTheAutoMockingContainer.aspx)

# re: Which Dependency Injection Framework?

Tuesday, January 13, 2009 8:09 AM by Murali

What you people think about AutoFac?

# re: Which Dependency Injection Framework?

Wednesday, June 01, 2011 1:48 AM by weblogs.asp.net

Which dependency injection framework.. Great idea :)

Leave a Comment

(required) 
(required) 
(optional)
(required)