gpt4 book ai didi

c# - 迁移 "our target project ' xxx' 与您的迁移程序集 'xxx' 不匹配“使用 aspnet Core 1.0 RC2 -

转载 作者:行者123 更新时间:2023-12-02 04:09:29 26 4
gpt4 key购买 nike

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

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

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.

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

最佳答案

由于未知原因,我的项目/解决方案文件夹有点损坏。我删除了 I 并重新克隆了 Git 存储库。我终于能够进行迁移了。

关于c# - 迁移 "our target project ' xxx' 与您的迁移程序集 'xxx' 不匹配“使用 aspnet Core 1.0 RC2 -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37490804/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com