Bug: How to fix Exception Could not load file or assembly 'EntityFramework, Version=4.0.0.0[…]' or o

5 篇文章 0 订阅

原文: http://www.cnetion.com/how-to-fix-exception-could-not-load-file-or-assembly-entityframework-version-4-qq-AUvBha09ivICeoL1jpEq.php

问题:

I installed EF6 and then realized MySQL has yet to provide support for it on their Connector/Net. So Naturally I rolled back and now I'm getting the error cited in the title.

My app.config looks like this

<?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
Created By: Microsoft Corporation
Verison: 5.0.20627.0

Additionally I have referenced the following assemblies:

Name: System.Data
Version: 4.0.0.0
File Version: 4.030319.17929

Name: System.Data.Entity
Version: 4.0.0.0
File Version: 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. The located assembly's manifest definition does not match the assembly reference. (Exception from 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.
<section name="entityFramework" 
          type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
          requirePermission="false" />



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值