The term 'Enable-Migrations' is not recognized mvc code first

梦想与她 提交于 2019-12-21 07:20:09

问题


I'm trying to run for the first time in my new mvc 4 application PM> Enable-Migrations –EnableAutomaticMigrations

I'm geting:

Enable-Migrations : The term 'Enable-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.
At line:1 char:1
+ Enable-Migrations –EnableAutomaticMigrations

What am I missing? I have installed e.f 5.


回答1:


Try typing in Package Manager Console:

Install-Package EntityFramework -IncludePrerelease

and then Restart Visual Studio.




回答2:


First "Install-Package EntityFramework -IncludePrerelease" and then Restarting Visual Studio as a Administrator worked for me together.

[Refer this] : Package Manager Console Enable-Migrations CommandNotFoundException only in a specific VS project




回答3:


I had the framework installed (5.x) and retried running the same commands after running in admin mode. This has resolved the issue -- quite strange though.




回答4:


You have to make sure that you don't have any square brackets "[" in your path directory of the project. Apparently VS 2013 is not happy with project folders named with square brackets.



来源:https://stackoverflow.com/questions/17363059/the-term-enable-migrations-is-not-recognized-mvc-code-first

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!