我无法运行我的迁移 - 这非常烦人,因为我无法继续我的项目......
我认为它必须与ef工具有关,因为一段时间(一个月)这个项目中的迁移工作。
Add-Migration命令成功运行,但后续Update-Database失败并出现以下错误:
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,但没有任何建议没有帮助我。
我尝试过的:
我的解决方案是将解决方案中的所有项目从4.7.2转换为.NET Core 2.2。 (所有NuGets(EFCore,EFCore.Design)都升级到v2.2.2)。之后,迁移开始起作用。