IoC container for .NET (C#) Lightweight. XML-configurable. Fast.

Lightweight XML-configurable (Spring-like) inversion of control container for .NET. NI.Ioc is used in NReco Framework applications.


  • Configurable with Spring-like XML syntax
  • Supports constructor and setter injections
  • Effectively handles large XML configurations (25 Mb and bigger)
  • Fast: >100,000 object instantiations per second
  • Supports multi-file configurations with Mvp.Xml XInclude implementation
  • Really lightweight: all you need is one assembly (55kb!)
  • Free and open source (LGPL)


how to use

  1. Install NI.Ioc nuget package
  2. using NI.Ioc;
    var config = new XmlComponentConfiguration(xmlConfigString);
    IComponentFactory ioc = new ComponentFactory(config);
    var sb = ioc.GetComponent<StringBuilder>("sb1");

XML configuration example