title: Asp.Net Core 3.0 use HttpClientFactory with Autofac
body: <p>I have a quite default Asp.Net Core 3.0 RestAPI application. For some services inside I would like to use Asp.Net Core's builtin HttpClientFactory.</p>
  
  <p>So I have these in my Startup.cs in ConfigureServices</p>
  
  <pre><code>services.AddHttpClient&lt;IService1, Service1&gt;(client =&gt;
  {
       client.Timeout = TimeSpan.FromSeconds(30);
  });
  services.AddHttpClient&lt;IService2, Service2&gt;(client =&gt;
  {
       client.Timeout = TimeSpan.FromSeconds(120);
  });
  </code></pre>
  
  <p>And one of my Service constructor seems like this:</p>
  
  <pre><code>protected Service1(HttpClient client)
  {
      this.client = client;
  }
  </code></pre>
  
  <p>In my Startup.cs I have DI config section for Autofac:</p>
  
  <pre><code>public void ConfigureContainer(ContainerBuilder builder)
  {
      builder.RegisterType&lt;Service1&gt;().As&lt;IService1&gt;();
      builder.RegisterType&lt;Service2&gt;().As&lt;IService2&gt;();
  }
  </code></pre>
  
  <p>My problem, this is not working, because of Autofac doesn't know about MS DI base HttpClientFactory settings in ConfigureServices. What should I configure to use Asp.Net Core HttpClientFactory with Autofac?</p>
  
  <p>I also tried this advice: <a href="https://stackoverflow.com/questions/52291150/autofac-fails-to-resolve-enumerable-of-typed-httpclients">Autofac fails to resolve enumerable of typed HttpClients</a></p>