I had a .NET core 1.0 webapp working fine. I had to upgrade to .NET Core 2.0. I also had to add a migration step for my SQLite database.
If I launch this command:>
A possible solution to IDesignTimeDbContextFactory<> problem is the DBContext discovery/launch during the add-migration process. Add migrations needs to get a context. If it cant, this error is thrown. This can happen if you do not have a public parameter-less DBContext. So a solution is to Add a public Parameter-less constructor to your context.
public class SomeDbContext: DbContext
{
// this PUBLIC constructor is required for Migration tool
public SomeDbContext()
{
}
// the model...
public DbSet PocoBlas { get; set; }
....
}
You can have a special version of your DBContext in a separate project .netCore console project for migration code generation purposes.