Cav*_*len 33 asp.net entity-framework connection-string data-access-layer entity-framework-5
我首先使用.NET 4.0,MVC3和EF5代码.
我的解决方案分为三个项目,依赖项如下所示:
Project.Web - > Project.BLL - > Project.DAL
Project.DAL层包含我的实体框架数据上下文类和我的所有实体,但我的启动项目是Project.Web,因此它包含我的Web.config,连接字符串和实际的SQL压缩数据库.
我正在尝试启用迁移,因此我可以在不擦除现有数据的情况下向EF模型添加新表.但是,当我运行"启用 - 迁移"时,我得到了
No context type was found in the assembly 'Project.Web'.
Run Code Online (Sandbox Code Playgroud)
如果我将启动项目设置为Project.DAL,则错误更改为
Could not load assembly 'Project.Web'. (If you are using Code First Migrations inside Visual Studio this can happen if the startUp project for your solution does not reference the project that contains your migrations. You can either change the startUp project for your solution or use the -StartUpProjectName parameter.)
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会出现这个错误或者我可以做些什么来修复它?
| 归档时间: |
|
| 查看次数: |
35789 次 |
| 最近记录: |