使用 aspnet Core 1.0 RC2 迁移 "our target project 'xxx' doesn't match your migrations assembly 'xxx'" -

Migration "our target project 'xxx' doesn't match your migrations assembly 'xxx'" using aspnet Core 1.0 RC2 -

我正在尝试为程序集中的第二个 DBContext 构建迁移 类。使用此命令:Add-Migration AlertInitial -c Axper.Data.Persistence.Context.AlertContext 并使用 "Package Console management"

但是它失败并给我这个错误:

Your target project 'AxPortal' doesn't match your migrations assembly 'Axper.Data.Persistence'. Either change your target project or change your migrations assembly. Change your migrations assembly by using DbContextOptionsBuilder. E.g. options.UseSqlServer(connection, b => b.MigrationsAssembly("AxPortal")). By default, the migrations assembly is the assembly containing the DbContext.

Change your target project to the migrations project by using the Package Manager Console's Default project drop-down list, or by executing "dotnet ef" from the directory containing the migrations project.

我不明白这个错误是什么意思,也不知道如何解决它。 有人可以帮忙吗?

由于未知原因,我的 projects/Solution 文件夹有点损坏。我删除了 I 并重新克隆了 Git 存储库。我终于可以迁移了。

options.UseSqlServer(connection, b => b.MigrationsAssembly("WebApplication3")). By default, the migrations assembly is the assembly containing the DbContext.

services.AddDbContext<ComDbContext>(options =>
            {
                options.UseSqlServer("server=.\sqlexpress;database=dsafdsaf;uid=sa;pwd=123456", b => b.MigrationsAssembly("WebApplication3"));
            });