Autofac with MVC4: controller does not have a default constructor
问题 I've been working with Autofac in MVC3 and love it. Now I am trying to implement it with MVC4. I installed the pre-release versions of Autofac MVC4 and Autofac WebApi through the Package Manager Console (Install-Package Autofac.Mvc4 -Pre and Install-Package Autofac.WebApi -Pre) I adjusted my IoC container as following: private static void SetAutofacContainer() { var builder = new ContainerBuilder(); builder.RegisterControllers(Assembly.GetExecutingAssembly()); builder.RegisterApiControllers