Code First 启用迁移时出错 HRESULT:0x80131040

问题:Enable-Migrations 使用“8”个参数调用“CreateInstanceFrom”时发生异常 (异常来自 HRESULT:0x80131040)

PM> Enable-Migrations
使用“8”个参数调用“CreateInstanceFrom”时发生异常:“未能加载文件或程序集“EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。找到的程序集清单定义与程序集引用
不匹配。 (异常来自 HRESULT:0x80131040)”
所在位置 E:dataworkRoadpackagesEntityFramework.6.0.0-rc1	oolsEntityFramework.psm1:698 字符: 31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodTargetInvocation

解决方法:统一各个项目下EntityFramework的版本,然后重启Visual Studio。

参考资料:http://stackoverflow.com/questions/12318107/enabling-code-first-entity-framework-vs-web-express-2012

原文地址:https://www.cnblogs.com/ruanying/p/3308198.html