EntityFramework 7(EF7)迁移. DbContext和启动项目在不同的程序集中 [英] EntityFramework 7 (EF7) Migrations. DbContext and StartUp Project are in different assemblies

查看:256
本文介绍了EntityFramework 7(EF7)迁移. DbContext和启动项目在不同的程序集中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将EF7中的迁移与entityframework.commands一起使用.但是我的DbContext与启动项目在不同的程序集中(asp.net mvc是一个启动项目,而Core.Implementation有一个DbContex).

I'm trying to use migrations in EF7 with entityframework.commands. But my DbContext is in different assembly with Start-up project (asp.net mvc is an start-up project and Core.Implementation has a DbContex).

dnx. ef迁移添加MyMigration -c MyContext

System.InvalidOperationException:未找到名为"MyContext"的DbContext.

我尝试使用名称空间指向其他程序集,但是它也不起作用.有可能吗?还是只需要将上下文放在ef7命令所在的程序集中?

I've tried to use namespace to point to other assembly but it didn't work either. Is it possible at all? Or I just have to put my context in assembly where ef7 command is?

推荐答案

每个问题#639 #2256 #2294 #2357 #2748 ,我们在该领域还有很多工作要做. :-)

Per issues #639, #2256, #2293, #2294, #2357, #2553 & #2748, we have a bit of work to do in that area. :-)

这篇关于EntityFramework 7(EF7)迁移. DbContext和启动项目在不同的程序集中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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