0
在RC1中,我可以使用命令dnx ef migrations添加NAME --targetProject Core,其中Core包含我的上下文和我的迁移。我如何将迁移放置在Core项目中而不是包含我的DI的Web项目中?EF7 RC2如何更改目标项目
在RC1中,我可以使用命令dnx ef migrations添加NAME --targetProject Core,其中Core包含我的上下文和我的迁移。我如何将迁移放置在Core项目中而不是包含我的DI的Web项目中?EF7 RC2如何更改目标项目
我认为你的问题是你使用class library
项目。在EF Core的RC2中,您不能将DBContext放置在这样的项目中。这是一个已知的问题。当您将其转换为“应用程序”项目时,它应该再次运行。
更多信息&来源:
解决方法:https://docs.efproject.net/en/latest/cli/dotnet.html#dotnet-cli-issues
Github的问题: https://github.com/aspnet/EntityFramework/issues/5460
乐于助人的链接,从升级到RC1 RC2:https://docs.efproject.net/en/latest/miscellaneous/rc1-rc2-upgrade.html