尝试执行添加迁移时,.NET Core软件包管理器控制台挂起

时间:2019-06-19 08:36:21

标签: c# asp.net asp.net-mvc asp.net-core

当我要添加迁移时,这些是我在键入add-migration命令之前执行的步骤:

  1. $ env:CENTRAL_APPLICATION_SETTINGS =“ C:\ Users \ amosa \ source \ repos \ DotNetCore \ CentralApplicationSettings \ CentralApplicationSettings”
  2. $ env:DOCUMENT_STUDIO_CONNECTIONSTRING =“服务器=。\ SQLEXPRESS;数据库= DBONE; Trusted_Connection = False; MultipleActiveResultSets = true;用户ID =用户;密码=密码”
  3. $ env:DOCUMENT_STUDIO_DSSCHEMA =“ DocumentStudio”
  4. $ env:ASPNETCORE_ENVIRONMENT =“开发”

添加迁移DocumentStudioBaseMigration -Context DocumentStudioDbContext -OutputDir Migrations \ DocumentStudioMigrations

这是我使用的dbcontext文件:

public DocumentStudioDbContext(DbContextOptions<DocumentStudioDbContext> options) : base(options) { }
public DbSet<Documents> Documents { get; set; }
public DbSet<DocumentCategories> DocumentCategories { get; set; }
public DbSet<DocumentFields> DocumentFields { get; set; }
public DbSet<DocumentFieldsStore> DocumentFieldsStore { get; set; }
public DbSet<DocumentFieldPermissions> DocumentFieldPermissions { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.HasDefaultSchema(schema: Environment.GetEnvironmentVariable(DSCASGlobals.DS_DatabaseSchema));
    base.OnModelCreating(modelBuilder);
}

当我进入添加迁移部分时,我的包管理器只是挂起而什么也不做。我以前从未遇到过这个问题,似乎什么也没发生。

0 个答案:

没有答案