连接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.Entity
6.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是怎么一回事,我就不啰嗦了.但为什么你还要继续阅读此文呢?可能是以前你习惯复制粘贴一些代码,并没有真正弄懂代码的含 ...
随机推荐
- springMvc解决json中文乱码
springMvc解决json中文乱码 springMvc解决json中文乱码,springMvc中文乱码,spring中文乱码 >>>>>>>>> ...
- Android 5.0 全新的动画
触摸反馈 ripple 触摸反馈是指用户在触摸控件时的一种可视化交互,在Android L之前,通常是通过press色变来凸显,但是因为是瞬间变化的效果,不如动画生动. 在Android L 中定义了 ...
- 页面跳转 url地址的写法
跳转地址:分两类,wikipage和aspx页面: wikipage:当新建webpart,在网站里新建一个wikipage,然后将webpart添加进wikipage,这种情况下跳转页面需要添加si ...
- javascript类继承系列三(对象伪装)
原理:在子类的构造器上调用超类构造器(父类构造器中的this指向子类实例),js提供了apply()和call()函数,可以实现这种调用 function baseClass() { this.col ...
- iis7.5 应用程序池 经典模式和集成模式的区别
在 IIS 7.5 中,应用程序池有两种运行模式:集成模式和经典模式. 应用程序池模式会影响服务器处理托管代码请求的方式. 如果托管应用程序在采用集成模式的应用程序池中运行,服务器将使用 IIS 和 ...
- 配置MyEclipse+Hibernate连接Sql Server 2008出错
下文主要是讲述最近配置MyEclipse连接Sql Server 2008时遇到的一个问题,而不关注如何配置Sql Server 2008支持TCP/IP连接.Hibernate如何操作Sql Ser ...
- iOS相关,过年回来电脑上的证书都失效了,解决方法。
今天发了个问题,就是关于电脑上的证书都失效的问题,就这个问题的解决方法如下:https://segmentfault.com/q/1010000004433963 1,按照链接下载,https://d ...
- 常见 PL.SQL 数据库操作
Oracle PL/SQL 1, Alt +E 2, 默认大写功能, 解析SQL原则,Comment,UnComment. 3, 触发Trig,使用Test Window. 4, Compile In ...
- CSS 导航栏
实例: 导航栏 Home News Articles Forum Contact About 导航栏 熟练使用导航栏,对于任何网站都非常重要. 使用CSS你可以转换成好看的导航栏而不是枯燥的HTML菜 ...
- CSS 边框
CSS 边框属性 CSS边框属性允许你指定一个元素边框的样式和颜色. 边框样式 边框样式属性指定要显示什么样的边界. border-style属性用来定义边框的样式 border-style 值: ...