title: Custom Role Provider using DI ninject throwing error
body: <p>I setup a CustomRoleProver as:</p>
  
  <pre><code>public class CustomRoleProvider : RoleProvider
      {
          private readonly IRepository&lt;User&gt; _repository;
  
          public CustomRoleProvider(IRepository&lt;User&gt; repository)
          {
              _repository = repository;
          }
  
  ...
  </code></pre>
  
  <p>In my Global.asax.cs I have:</p>
  
  <pre><code>//Create Ninject DI kernel
              var kernel = new StandardKernel();
  
              kernel.Bind&lt;IRepository&lt;User&gt;&gt;().To&lt;Repository&lt;User&gt;&gt;();
  
              //Tell ASP.NET MVC 3 to use our Ninject DI Container
              DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
  </code></pre>
  
  <p>When I try to run my code I get:</p>
  
  <p>Configuration Error
  Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.</p>
  
  <p>Parser Error Message: No parameterless constructor defined for this object.</p>
  
  <p>Source Error:</p>
  
  <p>Line 64:             
  Line 65:                 
  Line 66:                 
  Line 67:             
  Line 68:         </p>
  
  <p>So maybe I have a totally incorrect understanding of DI and ninject. I thought that when it tried to  instantiate teh CustomRoleProvider it would create the user repository and pass it to the constructor not trying to use a parameterless one.</p>
  
  <p>Do I understand this incorrectly or is my setup just incorrect?</p>
  
  <p>I find this strange because the DI seems to be mostly working for the controllers.</p>