title: 'ILoggingBuilder' does not contain a definition for 'AddFile'
body: <blockquote>
    <p>ILoggingBuilder' does not contain a definition for 'AddFile' and the
    best extension method overload
    'FileLoggerExtensions.AddFile(ILoggerFactory, IConfigurationSection)'
    requires a receiver type of 'ILoggerFactory'</p>
  </blockquote>
  
  <p>Note the line in the code marked with <code>&lt;== Exception</code>.</p>
  
  <p>According to everything I can find online this should work, but I get the error above.</p>
  
  <p>I can't find anything to suggest what the problem is.</p>
  
  <p>Probably something daft. Any suggestions gratefully received!</p>
  
  <pre><code>using Microsoft.AspNetCore.Hosting;
  using Microsoft.Extensions.Hosting;
  using Microsoft.Extensions.Logging;
  
  namespace my.namespace
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              CreateHostBuilder(args).Build().Run();
          }
  
          public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
              Host.CreateDefaultBuilder(args)
                  .ConfigureLogging(logging =&gt;
                  {
                      logging.ClearProviders();
                      logging.AddFile("..."); // &lt;== Exception
                  })
                  .ConfigureWebHostDefaults(webBuilder =&gt;
                  {
                      webBuilder.UseStartup&lt;Startup&gt;();
                  });
      }
  }
  </code></pre>