Skip to content
This Ninject extension allows that child kernels can be defined.
C# Shell
Find file
Latest commit 353aa72 Nov 9, 2014 @scott-xu scott-xu Update

Ninject.Extensions.ChildKernel NuGet Version NuGet Downloads

This Ninject extension allows that child kernels can be defined. A child kernel is a Ninject kernel that has a parent kernel. All requests that it can't resolve are passed to the parent kernel.

Getting Started


public class Foo
  public Foo(IBar bar)
    this.Bar = bar;

  public IBar Bar { get; private set; }

public class Bar

var parentKernel = new StandardKernel();

var childKernel1 = new ChildKernel(this.parentKernel);

var childKernel2 = new ChildKernel(this.parentKernel);

var foo1 = childKernel1.Get<Foo>();
var foo2 = childKernel2.Get<Foo>();
var foo3 = childKernel1.Get<Foo>();

In this example foo1 and foo2 will be different instances. foo1 and foo3 are the same instance. And all share the same bar.


  • Objects that are resolved by the parent kernel can not have any dependency to an object defined on a child kernel. This is by design. Otherwise it would be possible to access objects on another child kernel if the object is defined as singleton.
  • Since version 3.0, implicit bindngs are resolved on the child kernel and not the parent kernel anymore.


CI build status

Build Status

Something went wrong with that request. Please try again.