title: Exception when I try to combine Autofac with AutoMapper`s IMappingEngine
body: <p>Thats my DI and Automapper setup:</p>
  
  <pre><code>[RoutePrefix("api/productdetails")]
  public class ProductController : ApiController
  {
      private readonly IProductRepository _repository;
      private readonly IMappingEngine _mappingEngine;
  
      public ProductController(IProductRepository repository, IMappingEngine mappingEngine)
      {
          _repository = repository;
          _mappingEngine = mappingEngine;
      }
  }
  
  public class WebApiApplication : System.Web.HttpApplication
  {
      protected void Application_Start()
      {
          GlobalConfiguration.Configure(WebApiConfig.Register);
  
          //WebApiConfig.Register(GlobalConfiguration.Configuration);          
          RouteConfig.RegisterRoutes(RouteTable.Routes);          
      }
  }
  
  
  public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          config.MapHttpAttributeRoutes();
          config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional });
  
          // Filter
          config.Filters.Add(new ActionExceptionFilter());
          config.Services.Replace(typeof(IExceptionHandler), new GlobalExceptionHandler());
  
  
          // DI
          // Register services
          var builder = new ContainerBuilder();
          builder.RegisterType&lt;ProductRepository&gt;().As&lt;IProductRepository&gt;().InstancePerRequest();
          builder.RegisterType&lt;MappingEngine&gt;().As&lt;IMappingEngine&gt;();
  
          // AutoMapper
          RegisterAutoMapper(builder);
  
          // FluentValidation
  
          // do that finally!
          // This is need that AutoFac works with controller type injection
          builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
          var container = builder.Build();
          config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
      }
  
      private static void RegisterAutoMapper(ContainerBuilder builder)
      {
          var profiles =
              AppDomain.CurrentDomain.GetAssemblies()
                  .SelectMany(GetLoadableTypes)
                  .Where(t =&gt; t != typeof (Profile) &amp;&amp; typeof (Profile).IsAssignableFrom(t));
          foreach (var profile in profiles)
          {
              Mapper.Configuration.AddProfile((Profile) Activator.CreateInstance(profile));
          }
  
      }
  
      private static IEnumerable&lt;Type&gt; GetLoadableTypes(Assembly assembly)
      {
          try
          {
              return assembly.GetTypes();
          }
          catch (ReflectionTypeLoadException e)
          {
              return e.Types.Where(t =&gt; t != null);
          }
      }
  }
  </code></pre>
  
  <p>Thats the exception I get when I go to a certain route:</p>
  
  <pre><code>None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'AutoMapper.MappingEngine' can be invoked with the available services and parameters:
  Cannot resolve parameter 'AutoMapper.IConfigurationProvider configurationProvider' of constructor 'Void .ctor(AutoMapper.IConfigurationProvider)'.
  Cannot resolve parameter 'AutoMapper.IConfigurationProvider configurationProvider' of constructor 'Void .ctor(AutoMapper.IConfigurationProvider, AutoMapper.Internal.IDictionary`2[AutoMapper.Impl.TypePair,AutoMapper.IObjectMapper], System.Func`2[System.Type,System.Object])'.
  </code></pre>
  
  <p><strong>QUESTION</strong></p>
  
  <p>What is wrong with my code?</p>