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

标签 c# entity-framework visual-studio-2015 entity-framework-migrations .net-core-rc2

我最近安装了 .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 : 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 迁移类吗?安装 RC2 之后?

最佳答案

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

Install-Package Microsoft.EntityFrameworkCore.Tools –Pre

几天前,我将一个带有 EF Core 1 RC2 的小应用程序推送到 GitHub ,其中添加迁移工作。如有必要,您可以将其作为引用。

关于c# - EF7 .NET Core 1 RC2 添加迁移失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37468792/

相关文章:

c# - 如何确保某些方法和字段仅对子类可见?

c# - TCP套接字服务器如何判断从客户端接收到的数据何时完成?

c# - StringBuilder 与字符串构造函数 - 字符

c# - 设计 View 未在 Visual Studio 2015 中打开

vb.net - VS2015 : The components for communicating with FTP servers are not installed

c# - 将字符串格式化为日期时间

c# - linq 中不允许使用 String.Format 或 toString

entity-framework - 从集合域驱动设计中删除对象

c# - 按周分组 EF Core 2.1

visual-studio - 安装程序检测到Visual Studio 2015 Update 3可能未完全安装。