title: .NET Core Entity Framework - Migration path --output-dir
body: <p>I have successfully created a migration file using .NET Core class library by using command: <code>dotnet ef --startup-project ../Project.Web migrations add Init</code></p>
  
  <p>Because I register my db context in a different layer, (web layer), and have class library, I have to set my startup project to Project.Web.</p>
  
  <p>After creating my initial migration it looks something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/7kTEu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7kTEu.png" alt="enter image description here"></a></p>
  
  <p>But now I would like to move the migration folder <code>Project.Data/Migrations</code> to <code>Project.Data/Database/Migrations</code></p>
  
  <p>I have tried using the output-dir parameter:</p>
  
  <pre><code>dotnet ef --startup-project ../Project.Web --output-dir Database migrations add Init
  </code></pre>
  
  <p>But then I get:</p>
  
  <blockquote>
    <p>dotnet : Unrecognized option '--output-dir'</p>
  </blockquote>
  
  <p><strong>Startup</strong> (in a different project, business layer)</p>
  
  <pre><code>public static IServiceCollection InjectBusinessContext(this IServiceCollection services, string connectionString)
  {
      services.AddEntityFrameworkSqlServer().AddDbContext&lt;ProjectContext&gt;((serviceProvider, options) =&gt; options.UseSqlServer(connectionString, b =&gt; b.MigrationsAssembly("Database")).UseInternalServiceProvider(serviceProvider));
  
      return services;
  }
  </code></pre>
  
  <p><strong>Context</strong> (data layer)</p>
  
  <pre><code>public class ProjectContext : DbContext
  {
      public ProjectContext(DbContextOptions&lt;ProjectContext&gt; options) : base(options)
      {
      }
  
      public DbSet&lt;Account&gt; Account { get; set; }
  }
  </code></pre>