迁移“我们的目标项目'xxx'与您的迁移程序集'xxx'不匹配”使用aspnet Core 1.0 RC2- [英] Migration "our target project 'xxx' doesn't match your migrations assembly 'xxx'" using aspnet Core 1.0 RC2 -

查看:585
本文介绍了迁移“我们的目标项目'xxx'与您的迁移程序集'xxx'不匹配”使用aspnet Core 1.0 RC2-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为程序集中的第二个DBContext构建迁移类。使用以下命令: Add-Migration AlertInitial -c Axper.Data.Persistence.Context.AlertContext
并使用包控制台管理

I'm trying to build the migration classes for a second DBContext in a assembly. using this command: Add-Migration AlertInitial -c Axper.Data.Persistence.Context.AlertContext and using the "Package Console management"

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

But it fail and give me this error:


您的目标项目 AxPortal不匹配您的迁移程序集
'Axper.Data.Persistence'。更改目标项目或更改迁移程序集
。通过使用
DbContextOptionsBuilder更改迁移程序集。例如。 options.UseSqlServer(connection,b =>
b.MigrationsAssembly( AxPortal))。默认情况下,迁移
程序集是包含DbContext的程序集。

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.

使用
包管理器控制台的目标程序将目标项目更改为迁移项目。默认项目下拉列表,或
在包含迁移
项目的目录中执行 dotnet ef。

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.

我无法弄清楚该错误的含义以及解决方法。
有人可以帮忙吗?

I can't figure what this error mean, and what to do to fix it. Can someone help?

推荐答案

由于未知原因,我的项目/解决方案文件夹已损坏。我删除了我,然后重新克隆了Git存储库。我终于可以进行迁移了。

For unknown reason, my projects/Solution folder was kind of corrupted. I deleted I and re-cloned the Git Repository. I i finally been able to do the migration.

这篇关于迁移“我们的目标项目'xxx'与您的迁移程序集'xxx'不匹配”使用aspnet Core 1.0 RC2-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆