title: Web API 2 Ninject "error occurred when trying to create a controller"
body: <p>I'm getting this error when loading my controller.</p>
  
  <pre><code>An error occurred when trying to create a controller of type 'MembersController'. Make sure that the controller has a parameterless public constructor.
  </code></pre>
  
  <p>I have added </p>
  
  <pre><code>System.Web.Http.GlobalConfiguration.Configuration.DependencyResolver = new Ninject.WebApi.DependencyResolver.NinjectDependencyResolver(kernel);
  </code></pre>
  
  <p>to the <code>NinjectWebCommon</code> class after registering the bindings.</p>
  
  <p>And I have registered the relevant services. see <strong><em>EDIT</em></strong> </p>
  
  <p><s></p>
  
  <pre><code> private static void RegisterServices(IKernel kernel)
   {
       kernel.Bind&lt;IMembersService, MembersService&gt;();
       kernel.Bind&lt;MemberContext, MemberContext&gt;();
   }        
  </code></pre>
  
  <p></s>
  Here are the ninject packages I have added - </p>
  
  <pre><code>  &lt;package id="Ninject" version="3.2.0.0" targetFramework="net451" /&gt;
    &lt;package id="Ninject.MVC5" version="3.2.1.0" targetFramework="net451" /&gt;
    &lt;package id="Ninject.Web.Common" version="3.2.0.0" targetFramework="net451" /&gt;
    &lt;package id="Ninject.Web.Common.WebHost" version="3.2.0.0" targetFramework="net451" /&gt;
    &lt;package id="Ninject.Web.WebApi" version="3.2.4.0" targetFramework="net451" /&gt;
    &lt;package id="Ninject.WebApi.DependencyResolver" version="0.1.4758.24814" targetFramework="net451" /&gt;
  </code></pre>
  
  <p>What am I missing? </p>
  
  <p><strong><em>EDIT</em></strong> </p>
  
  <p>Thanks to my conversation with Jerrod Horton (below) I realized I doing the binding incorrectly. </p>
  
  <p>Should have been </p>
  
  <pre><code>private static void RegisterServices(IKernel kernel)
  {
      kernel.Bind&lt;IMembersService&gt;().To&lt;MembersService&gt;();
      kernel.Bind&lt;MemberContext&gt;().To&lt;MemberContext&gt;();
  }
  </code></pre>