【发布时间】:2020-10-23 04:53:08
【问题描述】:
尝试添加迁移 add-migration "Inicial" -Verbose 时,会出现以下错误消息:No migrations configuration type was found in the assembly 'DevIO.UI.Site'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
我按照消息说明输入命令Enable-Migrations,但还是报错No context type was found in the assembly 'DevIO.UI.Site'
我能做什么?
【问题讨论】:
-
它仍然不能解决我的问题。我不断收到消息:在程序集“DevIO.UI.Site”中找不到上下文类型。
-
您的屏幕截图中的错误与您的问题中的错误不同。在屏幕截图中,您输入了
StartUpProjectName AppModelo2,但这是您的解决方案的名称,而不是项目的名称。你的项目是DevIO.UI.Site。 -
这是我尝试过的众多方法之一。
-
您尝试使用哪个版本的实体框架?您的屏幕截图显示
using Microsoft.EntityFrameworkCore,但您已将问题标记为entity-framework,而不是entity-framework-core。对于 EF 6 或更低版本,上下文应位于System.Data.Entity中,您似乎没有使用它。
标签: entity-framework-core entity-framework-migrations