2015-11-04 38 views
8

我使用ASP.NET 5測試版8 Entity Framework 7測試版8DNX:錯誤:無法加載應用程序或執行命令「EF」

我創建了一個新的類庫包使用。

我跑到下面安裝軟件包提示:

Install-Package EntityFramework.SqlServer -Pre 
Install-Package EntityFramework.Commands -Pre 
Install-Package Microsoft.AspNet.Identity.EntityFramework -Pre 

project.json

{ 
"version": "1.0.0-*", 
"description": "MARS Class Library", 
"authors": [ "myname" ], 
    "tags": [ "" ], 
    "projectUrl": "", 
    "licenseUrl": "", 
    "frameworks": { 
    "dnx451": { } 
    }, 
    "dependencies": { 
    "EntityFramework.Commands": "7.0.0-beta8", 
    "EntityFramework.SqlServer": "7.0.0-beta8", 
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta8", 
    } 
} 

在我的包管理器控制檯我瀏覽到我的src\project目錄在其中project.json位於和運行任何dnxef命令例如:

dnx ef migrations --help 

 dnx ef migrations add InitialMigration 

不過,我得到以下錯誤:

dnx : Error: Unable to load application or execute command 'ef'.

At line:1 char:1

  • dnx ef migrations --help

  • ~~~~~~~~~~~~~~~~~~~~~~~~

    • CategoryInfo : NotSpecified: (Error: Unable t...e command 'ef'.:String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError

我有一個的DbContext類和模型類,但錯誤似乎與不能夠理解他們的關鍵字ef所有。

我錯過了什麼?

回答

16

解決方案:

添加ef命令添加到您project.json

"commands": { 
     "ef": "EntityFramework.Commands" 
    } 
相關問題