在Visual Studio 2015中如何管理EF 6迁移? [英] How can I manage EF 6 migrations in visual studio 2015?

查看:257
本文介绍了在Visual Studio 2015中如何管理EF 6迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2013最新更新开始了一个新的MVC项目,使用 EntityFramework -Version 6.1.2 。我进行了几次迁移并更新了数据库。之后,我在另一台计算机上检出该项目,并使用Visual Studio 2015 CTP 6打开。

I started a new MVC project with EntityFramework -Version 6.1.2 using Visual Studio 2013 latest update. I made a couple of migrations and updated the database. After this I checked out the project on another computer and opened with Visual Studio 2015 CTP 6.

如果我进入软件包管理器控制台并尝试运行任何迁移命令,它们不被识别:

If I go in the package manager console and try to run any migration commands, they're not recognized:


add-migrations:术语添加迁移不被识别为cmdlet的名称,函数,脚本文件或可操作的程序。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。

add-migrations : The term 'add-migrations' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

我如何在Visual Studio 2015中使用Entity Framework 6管理我的迁移?

How can I manage my migrations using Entity Framework 6 in Visual Studio 2015?

推荐答案

您是否尝试卸载并重新安装EntityFramwork NuGet软件包?我遇到了同样的问题,解决了它。

Have you tried uninstalling and reinstalling EntityFramwork NuGet package? I had the same issue as described and it solved it.

这篇关于在Visual Studio 2015中如何管理EF 6迁移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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