简体   繁体   English

如何修复异常无法加载文件或程序集'EntityFramework,Version = 4.0.0.0 [...]'或其依赖项之一

[英]How to fix Exception Could not load file or assembly 'EntityFramework, Version=4.0.0.0[…]' or one of its dependencies

I installed EF6 and then realized MySQL has yet to provide support for it on their Connector/Net. 我安装了EF6,然后意识到MySQL还没有在他们的Connector / Net上提供支持。 So Naturally I rolled back and now I'm getting the error cited in the title. 所以我自然而然地回过头来,现在我得到了标题中引用的错误。

My app.config looks like this 我的app.config看起来像这样

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
</configuration>

and my references look like: 我的推荐看起来像:

Name: EntityFramework.dll 名称: EntityFramework.dll
Created By: Microsoft Corporation 创建者: Microsoft Corporation
Verison: 5.0.20627.0 Verison: 5.0.20627.0

Additionally I have referenced the following assemblies: 另外,我引用了以下程序集:

Name : System.Data 名称 :System.Data
Version : 4.0.0.0 版本 :4.0.0.0
File Version : 4.030319.17929 文件版本 :4.030319.17929

Name : System.Data.Entity 名称 :System.Data.Entity
Version : 4.0.0.0 版本 :4.0.0.0
File Version : 4.030319.17929 文件版本 :4.030319.17929

The Exact text of the Exception I get is: 我得到的例外的确切文本是:

An error occurred creating the configuration section handler for entityFramework: Could not load file or assembly 'EntityFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. 为entityFramework创建配置节处理程序时出错:无法加载文件或程序集'EntityFramework,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 定位的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040) (HRESULT异常:0x80131040)

How can I fix this?? 我怎样才能解决这个问题??

Your configuration refference version and installed versions are mismatch.You should change the following line of code ,because of you refference entityframework version 5.0.0.0 dll.So just try with replacing following line of code. 您的配置参考版本和安装的版本不匹配。您应该更改以下代码行,因为您参考entityframework版本5.0.0.0 dll.So只是尝试替换以下代码行。

<section name="entityFramework" 
          type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
          requirePermission="false" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集&#39;System,Version = 4.0.0.0,Culture = neutral&#39;或其依赖项之一 - Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral' or one of its dependencies 无法加载文件或程序集“EntityFramework”或其依赖项之一 - Could not load file or assembly 'EntityFramework' or one of its dependencies EF降级:无法加载文件或程序集“ EntityFramework”或其依赖项之一 - EF Downgraded: Could not load file or assembly 'EntityFramework' or one of its dependencies WCF:无法加载文件或程序集“ EntityFramework”或其依赖项之一 - WCF: Could not load file or assembly 'EntityFramework' or one of its dependencies 无法加载文件或程序集“ EntityFramework.SqlServer”或其依赖项之一 - Could not load file or assembly 'EntityFramework.SqlServer' or one of its dependencies 无法加载文件或程序集&#39;System,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 561934e089&#39;或其依赖项之一 - Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=561934e089' or one of its dependencies 无法加载文件或程序集“System.Web,Version = 4.0.0.0,Culture = neutral”或其依赖项之一。 访问被拒绝 - Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied 无法加载文件或程序集“系统,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089”或其依赖项之一 - Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies 无法加载文件或程序集“System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或其依赖项之一 - Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies 无法加载文件或程序集“System.Runtime,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一 - Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM