Please enable Javascript to correctly display the contents on Dot Net Tricks!

What is IoC Container or DI Container

  Author : Shailendra Chauhan
Posted On : 14 Apr 2013
Total Views : 86,409   
Updated On : 26 Sep 2016

The terms Dependency Injection (DI) & Inversion of Control (IoC) are generally used interchangeably to describe the same design pattern. Hence some people says IoC Container and some people says DI container but both terms indicate to the same thing. So don't be confused from the terminology. For more help about DI and IoC see Understanding Inversion of Control, Dependency Injection and Service Locator and Dependency Injection in ASP.NET MVC 4 using Unity IoC Container.

What is DI Container

A DI Container is a framework to create dependencies and inject them automatically when required. It automatically creates objects based on request and inject them when required. DI Container helps us to manage dependencies with in the application in a simple and easy way.

We can also manage an application dependencies without a DI Container, but it will be like as POOR MAN’S DI and we have to do more work, to make it configured and manageable.

List of popular DI Container for .Net

Today, there are a lot of excellent DI Containers that are available for .NET. Here, I am sharing the list of most useful DI Container for .Net framework.

Castle Windsor

  1. Based on the Castle MicroKernel.

  2. Well documented and used by many.

  3. Understands Decorator

  4. Typed factories

  5. Commercial support available


  1. It has been around since June 2004

  2. It is actively developed and works in many cases



  2. Comprehensive documentation

  3. Commercial support available


  1. Easy to learn API

  2. second-generation DI Container

  3. Commercial support available



  2. Good documentation

  3. Consistent API


  1. Easy to learn API

  2. Second-generation DI Container

What do you think?

I hope you will enjoy the tips while programming with .Net. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

Free Interview Books
20 JAN
ASP.NET Core with Angular4 (Online)
07:00 AM-09:00 AM IST / 07:30 PM Central Time
20 JAN
ASP.NET MVC with Angular (Classroom)
05:00 PM to 07:00 PM IST (+5:30 GMT)
20 JAN
ASP.NET MVC with Angular4 (Online)
03:00 pm to 05:00 pm
20 JAN
Angular2+4 with Firebase (Classroom)
03:00 PM to 05:00 PM IST (+5:30 GMT)
16 JAN
Developing Microsoft Azure Solutions (Online)
07:00 AM-09:00 AM IST/ 07:30 PM -09:30 PM CST
16 JAN
React with Redux (Online)
07:00 AM-08:30 AM IST
15 JAN
Big Data Hadoop Developer (Online)
05:00 PM to 06:30Pm IST / 06:30AM to 08:00AM CST
ASP.NET Core with Angular4 (Online)
09:00 Pm to 11:00 Pm IST (+5:30Gmt)
Big Data Hadoop Developer (Online)
07:00 AM - 08:30 AM IST(+5:30 GMT)
16 DEC
ASP.NET MVC with Angular4 (Classroom)
10:00 AM - 01::00 PM IST(+5:30 GMT)
12 DEC
ASP.NET MVC with Angular4 (Online)
09:00 PM - 11:00 PM IST(+5:30 GMT)
Developing Microsoft Azure Solutions (Online)
07:00 AM-09:00 AM IST / 08:30 PM Central Time
Angular2+4 with Firebase (Online)
10:30 AM-12:30 PM IST(+5.30 GMT)
27 NOV
ASP.NET Core (Online)
07:00 AM to 09:00 AM IST (+5:30 GMT)
11 NOV
ASP.NET MVC (Online)
08:00 AM-10:00 AM IST / 09:30 PM To 11:30 PM(CST)