System.IO.FileLoadException:无法加载文件或程序集 'EntityFramework,版本= 5.0.0.0,文化=中性, PublicKeyToken = b77a5c561934e089'或其依赖项之一。的 定位的程序集的清单定义与程序集不匹配 参考。 (来自HRESULT的异常:0x80131040)
App.config
htmlFor
packages.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0"/>
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
我尝试卸载并重新安装EF do all the Solution hear 而且我无法将目标框架更改为5,因为 我使用自动映射器
答案 0 :(得分:1)
检查几件事。
EF
版本支持以下版本
.Net
您正在使用。编辑:
每EntityFramework.dll
条检查您的参考书,并检查每本的版本。
答案 1 :(得分:0)
我有同样的问题,我只是确保在Web配置中的所有项目中都引用了正确的框架.Net。
我改变了
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
到
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework" requirePermission="false"/>