title: No parameterless constructor was found on 'ApplicationDbContext'. in Asp Core
body: <p>i create this for Initial Database in ASP Core . i using this : </p>
  
  <p><code>dotnet ef migrations add InitialCreate</code></p>
  
  <p>but it show me this error :</p>
  
  <blockquote>
    <p>No parameterless constructor was found on 'ApplicationDbContext'. Either add a parameterless constructor to 'ApplicationDbContext' or add an implementation of 'IDbContextFactory' in the same assembly as 'ApplicationDbContext'.</p>
  </blockquote>
  
  <p>but i created a Constuctor . whats the problem ? how can i solve this problem ?</p>
  
  <p>ApplicationDBContext:</p>
  
  <pre><code> public class ApplicationDbContext : ApplicationDbContextBase
  {
      public ApplicationDbContext(
          IOptionsSnapshot&lt;SiteSettings&gt; siteSettings
          , IHttpContextAccessor httpContextAccessor
          , IHostingEnvironment hostingEnvironment
          , ILogger&lt;ApplicationDbContextBase&gt; logger)
          : base(siteSettings, httpContextAccessor, hostingEnvironment, logger)
      {
      }
  
  
      protected override void OnModelCreating(ModelBuilder builder)
      {
          base.OnModelCreating(builder);
          builder.AddCustomIdentityMappings(SiteSettings.Value);
          builder.AddAuditableShadowProperties();
      }
  </code></pre>
  
  <p>ApplicationDbContextBase:</p>
  
  <pre><code>  public abstract class ApplicationDbContextBase :
     IdentityDbContext&lt;User, Role, int, UserClaim, UserRole, UserLogin, RoleClaim, UserToken&gt;,
     IUnitOfWork
  {
      protected readonly IHostingEnvironment HostingEnvironment;
      protected readonly IHttpContextAccessor HttpContextAccessor;
      protected readonly ILogger&lt;ApplicationDbContextBase&gt; Logger;
      protected readonly IOptionsSnapshot&lt;SiteSettings&gt; SiteSettings;
      private string v;
  
      public ApplicationDbContextBase(string v)
      {
          this.v = v;
      }
  
      protected ApplicationDbContextBase(
          IOptionsSnapshot&lt;SiteSettings&gt; siteSettings,
          IHttpContextAccessor httpContextAccessor,
          IHostingEnvironment hostingEnvironment,
          ILogger&lt;ApplicationDbContextBase&gt; logger)
      {
          SiteSettings = siteSettings;
          SiteSettings.CheckArgumentIsNull(nameof(SiteSettings));
  
          HttpContextAccessor = httpContextAccessor;
          HttpContextAccessor.CheckArgumentIsNull(nameof(HttpContextAccessor));
  
          HostingEnvironment = hostingEnvironment;
          HostingEnvironment.CheckArgumentIsNull(nameof(HostingEnvironment));
  
          Logger = logger;
          Logger.CheckArgumentIsNull(nameof(Logger));
      }
  </code></pre>
  
  <p><strong><em>Update</em></strong></p>
  
  <p>I upload the my Project in Github . 
  <a href="https://github.com/kia9372/DynamicPermisionWithIdnetityCore" rel="nofollow noreferrer">GitHub</a></p>