2013-06-28 43 views
13

我想,第一次在我的新的MVC 4應用 PM運行>啓用的遷移-EnableAutomaticMigrations術語「啓用的遷移」無法識別碼MVC第一

我在歌廳:

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 

我錯過了什麼?我已安裝e.f 5.

+1

你安裝了實體框架嗎?另外http://stackoverflow.com/q/11202718/1341477和http://stackoverflow.com/q/10411529/1341477和http://nuget.codeplex.com/workitem/2649 –

+0

對不起,只是編輯我的問題,我意思是5不是mvc 5!所以是的在回答你的問題... – Simon

+0

你想要數據庫遷移? –

回答

0

我已經安裝了框架(5.x)並重試在管理模式下運行後運行相同的命令。這已經解決了這個問題 - 雖然很奇怪。

14

試着鍵入在軟件包管理控制檯:

Install-Package EntityFramework -IncludePrerelease 

,然後重新啓動Visual Studio。

+3

重新啓動做了thrick! –

0

你必須確保你沒有任何方括號「[」在項目的路徑目錄。顯然VS 2013對用方括號命名的項目文件夾不滿意。