EF7 .NET Core 1 RC2 添加迁移失败

EF7 .NET Core 1 RC2 Add-Migration failing

我最近安装了 .NET Core 1.0 RC2,我知道命令 DNX 已更改为 dotnet.exe 命令,但我知道我找不到如何创建新的 EF7 迁移文件。 无论我尝试 "dotnet ef" 命令 我得到

dotnet : No executable found matching command "dotnet-ef"
At line:1 char:1
+ dotnet ef
+ ~~~~~~~~~
    + CategoryInfo          : NotSpecified: (No executable f...and "dotnet-ef":String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

还有类似的东西,如果在 VS PS 控制台 中尝试 "Add-Migration" 命令,给我这个:

Add-Migration : The term 'Add-Migration' 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
+ Add-Migration
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我在谷歌上搜索了 3 个小时,但没有任何结果。

感觉包裹少了

这里有人成功创建了新的 EF7 迁移吗class。安装 RC2 之后?

命令在 Tools 包中,因此 运行 在包管理器控制台中执行以下命令(或通过 NuGet 包管理器添加包 UI):

Install-Package Microsoft.EntityFrameworkCore.Tools –Pre

几天前,我将一个带有 EF Core 1 RC2 的小应用程序推送到 GitHub,其中 Add-Migration 起作用了。有需要的可以作为参考。

我找到了解决方案...

您需要将 Microsoft.EntityFrameworkCore.Tools 包添加到您的项目中

我发现了同样的问题。

在 Visual Studio 选项中的 Powershell 交互式控制台。

然后转到项目所在的目录。我需要位于包含项目文件的同一目录中。然后是显示 dotnet ef 命令行帮助数据的 运行 dotnet ef。