连接MySQL数据库得到错误“Unable to find the requested .Net Framework Data Provider”
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.4和Visual Studio 1.0.2 MySQL随后,然后这些指令测试:
- 创建一个连接到现有的MySQL数据库。
- 创建一个控制台应用程序。
- 添加麻烦。网络实体数据模型从现有数据库连接。
- 添加代码生成项EF 5。x DbContext发生器,取代了。tt文件。
- 编写一些代码,从数据库中检索记录。
运行应用程序时,我得到了这个异常:
ConfigurationErrorsException:没有找到或加载注册。净框架数据提供商。
然后我添加引用MySql.Data和MySql.Data.Entity6.7.4.0我库版本。NET 4.5项目。现在,当运行应用程序时,我得到一个不同的异常:
FileLoadException:无法加载文件或组装的MySql。数据、Version = 6.6.5.0 c5687fc88969c44d文化=中立,不能删除!请教如何解决这个问题”或它的一个依赖项。位于议会的清单定义不匹配装配参考。(从HRESULT例外:0 x80131040)
注意版本号,这不是MySQL连接器,我已经安装的版本。
我如何得到它正常工作?
诀窍解决这是:
- 添加引用
MySql.Data和MySql.Data.Entity库(6.7.4.0正确的版本。NET 4.5,在我的例子中)这一项目。 - 编辑
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”的更多相关文章
- entity framework 连接 oracle 发布后出现的问题(Unable to find the requested .Net Framework Data Provider)
用entity framework 搭建的一个windows 程序,在vs中用oracle 的ODT 工具连接oracle数据库,昨天发布后出现下面一个错误, System.ArgumentExcep ...
- 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 ...
- 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. ...
- Unable to find the requested .Net Framework Data Provider
换了个系统后发现VS2010和VS2012都有同样问题,在SQL EXPLORER 里连不上SQL Server,这也导致了打不开 dbml文件,会报错: The operation could no ...
- 错误:找不到请求的 .Net Framework Data Provider。可能没有安装.
一.错误描述 今天在帮同事Debug的时候遇到这个问题,错误信息提示到是Data Provider的问题,首先我们看下环境. 数据库版本:Oracle 11.2.0.4.0 64位 数据库服务器:li ...
- Navicat for mysql 远程连接 mySql数据库10061、1045错误
原文地址:http://www.111cn.net/database/mysql/46377.htm 有朋友可能会碰到使用Navicat for mysql 远程连接 mySql数据库会提示10061 ...
- Go连接MySql数据库Error 1040: Too many connections错误解决
原文:https://my.oschina.net/waknow/blog/205654 摘要: 使用Go链接数据库时,由于连接释放不当会在一段时间以后产生too many connections的错 ...
- 使用图形界面管理工具Navicat for MySQL连接Mysql数据库时提示错误:Can't connect to MySQL server (10060)
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢. https://blog.csdn.net/testcs_dn/article/details/ ...
- PHP连接MySQL数据库
PHP连接MySQL数据库 既然现在你看到了这篇文章,说明你肯定知道PHP和MySQL是怎么一回事,我就不啰嗦了.但为什么你还要继续阅读此文呢?可能是以前你习惯复制粘贴一些代码,并没有真正弄懂代码的含 ...
随机推荐
- 查询语句,按照时间排序,取前N条
mysql: SELECT * from (SELECT H_TEMPERATURE,TH_TIME FROM wenshidu WHERE TH_TIME <= STR_TO_DATE(' ...
- [XML] C#ResourceManagerWrapper帮助类 (转载)
点击下载 ResourceManagerWrapper.rar /// <summary> /// 类说明:ResourceManagerWrapper /// 编 码 人:苏飞 /// ...
- IIS本地部署项目出错
今天,打开部署在本地IIS的项目发现出错了.报的错,跟没有连接网络一样的.我当时有点懵,过一会儿再静下心来,想想这是什么原因. 第一步,把所有部署的项目,都打开看了一下,方便找出对比. 发现,绑定了I ...
- JavaScript 标准对象
在JavaScript的世界里,一切都是对象. 但是某些对象还是和其他对象不太一样.为了区分对象的类型,我们用typeof操作符获取对象的类型,它总是返回一个字符串: typeof 123; // ' ...
- JavaScript中Ajax的get和post请求
AJAX = 异步 JavaScript和XML(Asynchronous JavaScript and XML) 作用:在不重新加载整个网页的情况下,对网页的某部分进行更新. 两种请求方式: 1 ...
- jquery 过滤器
1.基本选择器 基本选择器是JQuery中最常用的选择器,也是最简单的选择器,它通过元素id.class 和标签名来查找DOM元素.这个非常重要,下面的内容都是以此为基础,逐级提高的. 1).“$(“ ...
- java 反射取得方法入参类型的泛形
package TestReflectClass; import java.util.List; /** * Created by wangyang on 2016/12/16. */ public ...
- C#后台程序与HTML页面中JS方法互调
此方法适用于 C#中嵌入WebBrowser(浏览器) 通过浏览器中加载的页面与C#的后台代码进行交互. 一.C#程序 1.在C#窗体中添加WebBrowser(浏览器),将页面的URL添加到浏览器中 ...
- django基本命令备忘录
1. 新建一个 django project django-admin.py startproject project-name 新建 app python manage.py startapp ap ...
- (三大框架SSH)面试题锦集
http://www.cnblogs.com/dieyf/p/4109233.html