DOTNET CLI RC2 EF 迁移

DOTNET CLI RC2 EF migrations

我刚刚从 RC1 迁移到 RC2,并且很难让 ef 命令和迁移工作。

我已经阅读了其他几个问题,并且 运行 了解此 link 中描述的已知问题。

问题是,如果我按照说明创建 b运行d 新控制台应用程序 (.core),我仍然会收到以下消息:

This preview of Entity Framework tools does not support targeting class library projects in ASP.NET Core and .NET Core applications. See http://go.microsoft.com/fwlink/?LinkId=798221 for details and workarounds.

我做错了什么?我需要恢复到 rc1 吗?

您是如何进行迁移的?我问是因为在我的情况下,一切都按时进行 - 就目前而言。

就我而言,我先删除了所有 RC1 组件,然后安装了新的 RC2 组件...

接下来,我使用新的 Visual Studio 模板创建了新的 APS 项目以获得正确的引用,并将我的代码移至这个新项目。

当然,我必须在我的代码中更新一些东西,但一切对我来说都很好,包括 ef 命令和迁移。


正如您在 ASP.NET Core installation guide

中看到的那样

Before you start

Remove all previous versions of .NET Core from your system by using Add/Remove programs.

您需要 RC1 安装文件来卸载此组件 - 如果您没有,请检查 Whosebug - 您可以找到 link 下载丢失的文件。


尝试按照文档:

ASP.NET 5 RC1 apps were based on the .NET Execution Environment (DNX) and made use of DNX specific features. ASP.NET Core RC2 is based on .NET Core, so you must first migrate your application to the new .NET Core project model. See Migrating from DNX to .NET Core CLI for more information.


希望这对你有帮助:)