EF 5 Enable-Migrations:在程序集中找不到上下文类型 [英] EF 5 Enable-Migrations : No context type was found in the assembly
本文介绍了EF 5 Enable-Migrations:在程序集中找不到上下文类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有 4 个项目:
Toombu.Entities : all models are there
Toombu.DataAccess: Mapping, Repository and ToombuContext
Toombu.Logique : Logic of my application
Toombu.Web : MVC 4 application. With all others DLL.
我尝试在 Toombu.Web 中启用迁移,但出现此错误:
I tried to enable migration in Toombu.Web but i had this error :
No context type was found in the assembly
如何启用迁移?
推荐答案
在包管理器控制台中使用 -ProjectName 选项:
use -ProjectName option in Package Manager Console:
Enable-Migrations -ProjectName Toombu.DataAccess -StartUpProjectName Toombu.Web -Verbose
这篇关于EF 5 Enable-Migrations:在程序集中找不到上下文类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文