We are using ASP.net MVC.
Which of these is the best DI framework Ninject or Unity and why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.