title: Entity Framework core: Cannot add migrations: No parameterless constructor
body: <p>My data project reference:   (Entity Framework Core) </p>
  
  <pre><code>    &lt;Project Sdk="Microsoft.NET.Sdk"&gt;    
        &lt;PropertyGroup&gt;
          &lt;TargetFramework&gt;netcoreapp1.1&lt;/TargetFramework&gt;
        &lt;/PropertyGroup&gt;    
        &lt;ItemGroup&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.1" /&gt;
          &lt;ProjectReference Include="..\Butv.Core\Butv.Core.csproj" /&gt;
          &lt;PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.0.3" /&gt;
  &lt;PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.1" PrivateAssets="All" /&gt;      
          &lt;PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.0.0" /&gt;    
        &lt;/ItemGroup&gt;
        &lt;ItemGroup&gt;
          &lt;DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" /&gt;  
        &lt;/ItemGroup&gt;
        &lt;ItemGroup&gt;
          &lt;Folder Include="Migrations\" /&gt;
        &lt;/ItemGroup&gt;
      &lt;/Project&gt;
  </code></pre>
  
  <p>The db Context:</p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
  {
       public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options) : base(options) { }
  
       protected override void OnModelCreating(ModelBuilder modelBuilder)
       {  ....
       }
  }
  public class ApplicationUser : IdentityUser
  {
  }
  </code></pre>
  
  <p>Every time I try command  </p>
  
  <blockquote>
    <p>dotnet ef migrations add Init --verbose</p>
  </blockquote>
  
  <p>, I get the error. It's used to work fine before I separate the Data project from the main project.</p>
  
  <blockquote>
    <p>Microsoft.EntityFrameworkCore.Design.OperationException: No parameterless constr
    uctor was found on 'ApplicationDbContext'. Either add a parameterless constructo
    r to 'ApplicationDbContext' or add an implementation of 'IDbContextFactory' in the same assembly as 'ApplicationDbContext'. ---> System.Mi
    ssingMethodException: No parameterless constructor defined for this object.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOn
    ly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Bo
    olean&amp; bNeedSecurityCheck)</p>
  </blockquote>