title: AutoFac Controller does not have a default constructor
body: <p>Hi I want to switch from Ninject to AutoFac but I'm having some problems. Error is:</p>
  
  <blockquote>
    <p>Controllers.API.Basic.AddressController' does not have a default
    constructor</p>
  </blockquote>
  
  <p>I register this at startup:</p>
  
  <pre><code>var builder = new ContainerBuilder();
  builder.RegisterControllers(Assembly.GetExecutingAssembly());
  builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
  
  builder.RegisterType&lt;AddressRepository&gt;().As&lt;IBaseRepository&lt;Address&gt;&gt;();
  
  builder.RegisterAssemblyModules(Assembly.GetExecutingAssembly());
  
  IContainer container = builder.Build();
  DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
  </code></pre>
  
  <p>and this is my controller:</p>
  
  <pre><code>public class AddressController : GenericBaseController&lt;Address&gt;
  {
      public AddressController(IBaseRepository&lt;Address&gt; repository)
          : base(repository)
      {
      }
  </code></pre>
  
  <p>Am I missing something? This worked with Ninject.</p>