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. 通过扫描包路径获取包内class

    public static Set<Class<?>> getClasses(ClassLoader classLoader, String pack) { Set<Cl ...

  2. C#开发的进化史

    1.数据类型的进化 C#1中实现Product类型代码 public class Product { string name; public string Name { get { return na ...

  3. 转--DataTable 修改列名 删除列 调整列顺序

    DataTable myDt =dt; //删除列 myDt.Columns.Remove("minArea"); myDt.Columns.Remove("maxAre ...

  4. Linux - 引用

    双引号 如果把文本放在双引号中,那么 shell 使用的所有特殊字符都将失去它们的特殊含义,而被看成普通字符.字符 "$"(美元符号)."\"(反斜杠).&qu ...

  5. [功能帮助类] C#取汉字拼音的首字母PinYin帮助类 (转载)

    点击下载 PinYin.rar 主要功能就是取汉字拼音的首字母,只要你输入一个汉字,或者是多个汉字就会取出相应的道字母,主要是方便查询使用的 /// <summary> /// 编 码 人 ...

  6. UDP—Socket,套接字聊天简单的聊天程序。

    思路:(发送端) 1.既然需要聊天.就应该怎么建立聊天程序,,DatagramSocket对象http://www.w3cschool.cc/manual/jdk1.6/ DatagramSocket ...

  7. oracle模糊查询效率提高

    1.使用两边加‘%’号的查询,oracle是不通过索引的,所以查询效率很低. 例如:select count(*) from lui_user_base t where t.user_name lik ...

  8. IOS-objectForKey与valueForKey在NSDictionary中的差异

    从 NSDictionary 取值的时候有两个方法,objectForKey: 和 valueForKey:,这两个方法具体有什么不同呢? 先从 NSDictionary 文档中来看这两个方法的定义: ...

  9. 检查.gitignore语法

    每次配置git的时候,要写gitignore文件,你知道你的.gitignore匹配那些文件吗? 看看.gitignore放过了哪些文件: git ls-files -ocm --exclude-st ...

  10. codeblocks快捷键(转载)

    • 按住Ctrl滚滚轮,代码的字体会随你心意变大变小. • 在编辑区按住右键可拖动代码,省去拉(尤其是横向)滚动条之麻烦:相关设置:Mouse Drag Scrolling. • Ctrl+D可复制当 ...