2017-11-30 11 views
0

私は、.netコア2クラスライブラリを作成しました。エンティティとエンティティのタイプ構成を作成しました。私はアドオンの移行を実行しようとしているTemporaryDbContextFactory.netコア2クラスライブラリにEFコアマイグレーションを追加するには?

public class TemporaryDbContextFactory : IDesignTimeDbContextFactory<EFDBContext> 
{ 
    public EFDBContext CreateDbContext(string[] args) 
    { 
     var builder = new DbContextOptionsBuilder<EFDBContext>(); 
     builder.UseSqlServer("Name=AppConnectionString", 
      optionsBuilder => optionsBuilder.MigrationsAssembly(typeof(EFDBContext).GetTypeInfo().Assembly.GetName().Name)); 
     return new EFDBContext(builder.Options); 
    } 
} 

を作成した後、DbContextに

public class EFDBContext : DbContext 
{ 
    public EFDBContext(DbContextOptions options) : base(options) 
    { 

    } 
} 

を作成しましたが、私は何も得ませんでした。移行は作成されません

私はここで何が欠けていますか?

+0

エラーが発生しましたか? – Entith

+0

エラーはありません。コマンドは実行されましたが、移行は作成されません –

答えて

4

問題#10298のように聞こえます。 *.csprojファイルに次を追加してください:

<PropertyGroup> 
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> 
</PropertyGroup> 
+0

スーパーマン..... –

関連する問題