title: No matching bindings are available, and the type is not self-bindable in Ninject
body: <p>I am using Ninjec, Ninject.Web.MVC and Ninject.Web.Common</p>
  
  <p>When I start my mvc application I get this binding error:</p>
  
  <p>What do I wrong in my binding?</p>
  
  <blockquote>
    <p>Error activating DbConnection</p>
    
    <p>No matching bindings are available, and the type is not self-bindable.</p>
    
    <p>Activation path:</p>
    
    <p>4) Injection of dependency DbConnection into parameter
    existingConnection of constructor of type DbContext</p>
    
    <p>3) Injection of dependency DbContext into parameter dbContext of
    constructor of type GenericRepository{User}</p>
    
    <p>2) Injection of dependency IGenericRepository{User} into parameter
    repo of constructor of type HomeController</p>
    
    <p>1) Request for HomeController</p>
    
    <p>Suggestions:</p>
    
    <p>1) Ensure that you have defined a binding for DbConnection.</p>
    
    <p>2) If the binding was defined in a module, ensure that the module
    has been loaded into the kernel.</p>
    
    <p>3) Ensure you have not accidentally created more than one kernel.</p>
    
    <p>4) If you are using constructor arguments, ensure that the parameter
    name matches the constructors parameter name.</p>
    
    <p>5) If you are using automatic module loading, ensure the search path
    and filters are correct.</p>
  </blockquote>
  
  <pre><code>public interface IGenericRepository&lt;T&gt; where T : class
  {
  }
  
  public class GenericRepository&lt;T&gt; : IGenericRepository&lt;T&gt; where T : class
  {
          public GenericRepository(TLPContext dbContext)
          {
              DbContext = dbContext;
          }
  
          protected TLPContext DbContext { get; private set; }
  }
  
  [assembly: WebActivator.PreApplicationStartMethod(typeof(TLP.App_Start.NinjectWebCommon), "Start")]
  [assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(TLP.App_Start.NinjectWebCommon), "Stop")]
  
  namespace TLP.App_Start
  {
      using Microsoft.Web.Infrastructure.DynamicModuleHelper;
      using Ninject;
      using Ninject.Web.Common;
      using System;
      using System.Web;
      using TLP.DataAccess;
      using TLP.DataAccess.Contract;
      using TLP.DataAccess.Implementation;
  
      public static class NinjectWebCommon
      {
          private static readonly Bootstrapper bootstrapper = new Bootstrapper();
          public static void Start()
          {
              DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
              DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
              bootstrapper.Initialize(CreateKernel);
          }
  
          public static void Stop()
          {
              bootstrapper.ShutDown();
          }
  
          private static IKernel CreateKernel()
          {
              var kernel = new StandardKernel();
              kernel.Bind&lt;Func&lt;IKernel&gt;&gt;().ToMethod(ctx =&gt; () =&gt; new Bootstrapper().Kernel);
              kernel.Bind&lt;IHttpModule&gt;().To&lt;HttpApplicationInitializationHttpModule&gt;();
              kernel.Bind&lt;TLPContext&gt;();
              kernel.Bind(typeof(IGenericRepository&lt;&gt;)).To(typeof(GenericRepository&lt;&gt;));
              return kernel;
          }
      }
  }
  
  
  [DbModelBuilderVersion(DbModelBuilderVersion.V5_0)]
      public class TLPContext : DbContext
      {
          public TLPContext()
              : base("DefaultConnection")
          {
              // We do not want implicit uncontrollable lazy loading, instead we use the explicit Load method
              this.Configuration.LazyLoadingEnabled = false;
          }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
  
              // Primary key
              modelBuilder.Entity&lt;User&gt;().HasKey(p =&gt; p.UserId);
              modelBuilder.Entity&lt;User&gt;().Property(p =&gt; p.FirstName).HasMaxLength(30).IsRequired();
              modelBuilder.Entity&lt;User&gt;().Property(p =&gt; p.RegisteredAt).IsRequired();
          }
  
          public DbSet&lt;User&gt; Users { get; set; }
      }
  </code></pre>