我无法运行迁移-这很烦人,因为我无法继续进行项目...
我认为必须使用 ef工具,因为前一段时间(一个月)该项目中的迁移有效。
添加迁移命令成功运行,但是随后的更新数据库失败,并出现以下错误:
Applying migration '20181129154443_strlen'.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Runtime.Remoting.RemotingException:
Cannot load type
'Microsoft.EntityFrameworkCore.Design.IOperationResultHandler,
Microsoft.EntityFrameworkCore.Design, Version=2.1.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
一些可能相关的信息:
有类似的问题(未回答): EF core migration failed: System.Runtime.Remoting.RemotingException: Cannot load type 'Microsoft.EntityFrameworkCore.Design.IOperationResultHandler 但是那里没有任何建议对我没有帮助。
我尝试过的事情:
答案 0 :(得分:0)
对我来说,解决方案是将解决方案中的所有项目从4.7.2转换为.NET Core 2.2。 (还将所有NuGets(EFCore,EFCore.Design)都升级到了v2.2.2)。之后,迁移开始起作用。