• 找不到请求的 .Net Framework Data Provider。可能没有安装


    1、2两步为推荐做法

    1. 将MySql.Data.dll放到 bin目录下面,或都安装 mysql-connector-net-6.0.0.msi

    2.web.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.0.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
        </DbProviderFactories>
      </system.data>

     3.全局配置

    在C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG中machine.config(xml文件)中有一个字段是<DbProviderFactories> 有写入MySQL Data Provider 项,

    如果是 .NET 4.0需要手动改一下 machine.config文件。将 v2.0.50727 下面的那段复制过去就OK了。

    添加注册,<name= "SqlClient Data Provider">或者<name="MySQL Data Provider"

    <system.data>
    
        <DbProviderFactories>
    
          <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    
          <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    
          <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    
          <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" />
    
          <add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    
         <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.0.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
    
    <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>

     

    注意替换红色背景处的版本。

  • 相关阅读:
    【设计模式】备忘录
    统计ip的发送频率和该ip发送的有效消息(去除相似消息)的数目
    Android之消息推送聊天实现
    Dictionary通过下标获取key和value
    SGU 271 水题。。。。
    二叉树递归和非递归遍历
    C#与SSL
    正则表达式总结
    SQL Server User Accounts
    嵌入式领域中各种文件系统的比较
  • 原文地址:https://www.cnblogs.com/vipsoft/p/2761121.html
Copyright © 2020-2023  润新知