title: Unable to create an object of type ApplicationDbContext that inherits from IdentityDBContext after migration to 3.0
body: <p>When I try to add a migration after migration to <strong>.net core 3.0 and ef core 3.0</strong> I get the error: Unable to create an object of type 'ApplicationDbContext'.</p>
  
  <p><a href="https://i.stack.imgur.com/ultdh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ultdh.png" alt="enter image description here"></a></p>
  
  <p>Dependencies are as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/dO5YH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dO5YH.png" alt="enter image description here"></a></p>
  
  <p>My code is as follows:</p>
  
  <p><strong>ApplicationDbContext.cs</strong></p>
  
  <pre><code>  public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;, ILocalizationDbContext
  {
      private readonly IServiceProvider _serviceProvider;
  
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
          : base(options)
      {
      }        
  
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options,
          IServiceProvider serviceProvider)
          : base(options)
      {
          _serviceProvider = serviceProvider;
      } 
     }
  </code></pre>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code> public void ConfigureServices(IServiceCollection services)
      {
  
          services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
              options.UseSqlServer(
                  Configuration.GetConnectionString("DefaultConnection"), 
                  b =&gt; b.MigrationsAssembly("Infrastructure")), 
              ServiceLifetime.Transient);
  
          services.AddDefaultIdentity&lt;ApplicationUser&gt;()
              .AddRoles&lt;IdentityRole&gt;()
              .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();
      }
  </code></pre>
  
  <p><strong>Program.cs</strong></p>
  
  <pre><code> public class Program
  {
      public static void Main(string[] args)
      {
          var host = Host.CreateDefaultBuilder(args)
                  .ConfigureWebHostDefaults(webHostBuilder =&gt;
                  {
                      webHostBuilder
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup&lt;Startup&gt;();
                  })
                  .Build();
  
          host.Run();
      }
  }
  </code></pre>