【发布时间】:2020-05-04 15:17:19
【问题描述】:
System.IO.FileLoadException:无法加载文件或程序集 'EntityFramework,版本=5.0.0.0,文化=中性, PublicKeyToken=b77a5c561934e089' 或其依赖项之一。这 定位程序集的清单定义与程序集不匹配 参考。 (HRESULT 异常:0x80131040)
App.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>
packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="9.0.0" targetFramework="net462" />
<package id="EntityFramework" version="5.0.0" targetFramework="net462" />
</packages>
我尝试卸载并重新安装 EF do all the Solution hear 我无法将目标框架更改为 5,因为 我使用自动映射器
【问题讨论】:
-
什么版本的.net?我看到你已经为 4.6.2 安装了它,但你用的是什么?
-
我确定我使用的是 .net 4.6.2
标签: c# entity-framework