Ninject vs Unity for DI

Miral picture Miral · Jun 28, 2009 · Viewed 50.1k times · Source

We are using ASP.net MVC.

Which of these is the best DI framework Ninject or Unity and why?

Answer

Mendelt picture Mendelt · Jun 28, 2009

Last time I looked at either of them I found Ninject slightly better. But both have their drawbacks.

Ninject has a better fluent-configuration scheme. Unity seems to rely mostly on XML configuration. Ninject's main drawback is that it requires you to reference Ninject.Core everywhere in your code to add [Inject] attributes.

If I may ask, why are you limiting your choices to these two? I think Castle.Windsor, Autofac and StructureMap are at least as good or better.