Each .NET Framework data provider that supports a factory-based class registers configuration information in the DbProviderFactories section of the machine.config file on the local computer. The following configuration file fragment shows the syntax and format for System.Data.SqlClient.

<system.data>
<DbProviderFactories>
<add name="SqlClient Data Provider"
invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
</DbProviderFactories>
</system.data>

The invariant attribute identifies the underlying data provider. This three-part naming syntax is also used when creating a new factory and for identifying the provider in an application configuration file so that the provider name, along with its associated connection string, can be retrieved at run time.

 

我下载MySQL连接器/净6.7.4Visual Studio 1.0.2 MySQL随后,然后这些指令测试:

  1. 创建一个连接到现有的MySQL数据库。
  2. 创建一个控制台应用程序。
  3. 添加麻烦。网络实体数据模型从现有数据库连接。
  4. 添加代码生成项EF 5。x DbContext发生器,取代了。tt文件。
  5. 编写一些代码,从数据库中检索记录。

运行应用程序时,我得到了这个异常:

ConfigurationErrorsException:没有找到或加载注册。净框架数据提供商。

然后我添加引用MySql.DataMySql.Data.Entity6.7.4.0我库版本。NET 4.5项目。现在,当运行应用程序时,我得到一个不同的异常:

FileLoadException:无法加载文件或组装的MySql。数据、Version = 6.6.5.0 c5687fc88969c44d文化=中立,不能删除!请教如何解决这个问题”或它的一个依赖项。位于议会的清单定义不匹配装配参考。(从HRESULT例外:0 x80131040)

注意版本号,这不是MySQL连接器,我已经安装的版本。

我如何得到它正常工作?

 

诀窍解决这是:

  1. 添加引用MySql.DataMySql.Data.Entity库(6.7.4.0正确的版本。NET 4.5,在我的例子中)这一项目。
  2. 编辑machine.config与你的编辑器以管理员身份运行,和替换出现的所有MySQL版本6.6.5.0通过6.7.4.0 .

第二步,注意,有多个machine.config文件,一个用于每个框架版本(3.0,3.5,4.0)和结构(32位,64位)。还要注意的是machine.config文件。NET 4.5的。NET 4.0文件夹。你可以找到的machine.config文件:

C:\Windows\ Microsoft.NET \ Framework \ \配置

和:

C:\Windows\ Microsoft.NET \ Framework64 \ \配置

如果没有对MySQL的引用machine.config文件,您可能没有安装MySQL为Visual Studio。这样做,或添加以下的app.config您的项目的文件:

<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

连接MySQL数据库得到错误“Unable to find the requested .Net Framework Data Provider”的更多相关文章

  1. entity framework 连接 oracle 发布后出现的问题(Unable to find the requested .Net Framework Data Provider)

    用entity framework 搭建的一个windows 程序,在vs中用oracle 的ODT 工具连接oracle数据库,昨天发布后出现下面一个错误, System.ArgumentExcep ...

  2. SQL SERVER 遇到Unable to find the requested .Net Framework Data Provider. It may not be installed. (System.Data)

    今天新装的SQLSERVER 2012 EXPRESS 用于客户端程序 安装完成后打开登陆SQLSERVER 一切正常 当查看表定义.视图结构时,弹出一下内容 Unable to find the r ...

  3. mysql 找不到或无法加载已注册的 .Net Framework Data Provider和Unable to find the requested .Net Framework Data Provider. It may not be installed解决

    需要安装 mysql-connector-net-6.7.4.msi 在C盘安装mysql的位置找到三个DLL,复制到Bin文件夹下 在Web.config文件中添加对应配置: <system. ...

  4. Unable to find the requested .Net Framework Data Provider

    换了个系统后发现VS2010和VS2012都有同样问题,在SQL EXPLORER 里连不上SQL Server,这也导致了打不开 dbml文件,会报错: The operation could no ...

  5. 错误:找不到请求的 .Net Framework Data Provider。可能没有安装.

    一.错误描述 今天在帮同事Debug的时候遇到这个问题,错误信息提示到是Data Provider的问题,首先我们看下环境. 数据库版本:Oracle 11.2.0.4.0 64位 数据库服务器:li ...

  6. Navicat for mysql 远程连接 mySql数据库10061、1045错误

    原文地址:http://www.111cn.net/database/mysql/46377.htm 有朋友可能会碰到使用Navicat for mysql 远程连接 mySql数据库会提示10061 ...

  7. Go连接MySql数据库Error 1040: Too many connections错误解决

    原文:https://my.oschina.net/waknow/blog/205654 摘要: 使用Go链接数据库时,由于连接释放不当会在一段时间以后产生too many connections的错 ...

  8. 使用图形界面管理工具Navicat for MySQL连接Mysql数据库时提示错误:Can't connect to MySQL server (10060)

    版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢. https://blog.csdn.net/testcs_dn/article/details/ ...

  9. PHP连接MySQL数据库

    PHP连接MySQL数据库 既然现在你看到了这篇文章,说明你肯定知道PHP和MySQL是怎么一回事,我就不啰嗦了.但为什么你还要继续阅读此文呢?可能是以前你习惯复制粘贴一些代码,并没有真正弄懂代码的含 ...

随机推荐

  1. memcached 安装

    安装 memcached 需要 三部1,下载 memcached 放到php目录将php_memcached.dll 放到php的ext 目录 2,打开管理员命令,将memcached 拖拉到命令中, ...

  2. SSO单点登录之数据同步

    完成单点登录,我们便可以通过只登录一个账号,来访问不同系统,然而会遇到以下问题. 1. 通过A站登录的用户访问B站,在B站并没有真实用户,此时如果在B站新建用户,则可能造成用户信息不全,或者数据冲突等 ...

  3. Asp.net: WebForm基础上构建Mvc的方法

    添加引用: System.Web.Routing System.Web.Abstractions System.Web.Mvc 添加文件夹: Controllers, Views,  Views / ...

  4. (转)asp.net基础-HttpModule

    HttpModule是向实现类提供模块初始化和处置事件.当一个HTTP请求到达HttpModule时,整个ASP.NET Framework系统还并没有对这个HTTP请求做任何处理,也就是说此时对于H ...

  5. Android MVP模式的初识

      MVP是什么?或许在之前更多的人知道的是MVC这个模式(Model View Controller),然而MVP与MVC最不同的一点是M与V是不直接 关联的也是就Model与View不存在直接关系 ...

  6. Java 中判断char 是否为空格 和空

    //判断是否char是否为空import java.util.*; public class test{ public static void main(String[] args){ String ...

  7. QVW中实现日期区间的选择功能!

    QV在日期的选择上不是很灵活,日期区段的选择可以在列表框中直接用鼠标拖拉区段,如果跨周期比较长了还是不是很方便啦. 下面介绍的方式是完全实现了起始日期的选择功能. 注:日期这个字段在抽取的时候一定要格 ...

  8. 关于 const 成员函数

    成员函数如果是const意味着什么? 有两个流行概念:物理常量性和逻辑常量性. C++对常量性的定义采用的是物理常量性概念,即const 成员函数不可以更改对象内任何non-static成员变量.例如 ...

  9. Exercise DS

    #include <iostream> using namespace std; typedef struct Node { Node *next; int data; }Node, *L ...

  10. 24种设计模式--模版方法模式【Template Method Pattern】

    周三,9:00,我刚刚坐到位置,打开电脑准备开始干活.“小三,小三,叫一下其它同事,到会议室,开会”老大跑过来吼,带着淫笑.还不等大家坐稳,老大就开讲了,“告诉大家一个好消息,昨天终于把牛叉模型公司的 ...