具有不变名称“MySql.Data.MySqlClient"的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册

The ADO.NET provider with invariant name #39;MySql.Data.MySqlClient#39; is either not registered in the machine or application config file(具有不变名称“MySql.Data.MySqlClient的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册)
本文介绍了具有不变名称“MySql.Data.MySqlClient"的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用实体框架 6 到 mysql 服务器的 asp.net 解决方案.

I have an asp.net solution using entity framework 6 to mysql server.

现在我必须在新机器上解决这个问题,
但我有一些问题:
1) 构建解决方案时出现错误:具有不变名称'MySql.Data.MySqlClient' 的 ADO.NET 提供程序未在机器或应用程序配置文件中注册".

now I have to work on that solution on a new machine,
but I have some problems:
1) when building the solution I get error: "The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file".

App.config:

App.config:

<entityFramework>
  <providers>
    <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
  </providers>
</entityFramework>
<system.data>
  <DbProviderFactories>
    <remove invariant="MySql.Data.MySqlClient" />
    <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.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
  </DbProviderFactories>
</system.data>  

2) 打开 model.edmx 文件时,我收到消息:
实体模式设计器无法显示您请求的文件".

2) when opening model.edmx file I get message:
"the entity mode designer is unable to display the file you requested".

我已经在机器上安装了:

I have installed on the machine:

1) mysql 连接器/网络 6.9.9
2) Visual Studio 1.2.6 的 mysql
3) mysql 连接器 odbc 5.3.6.

1) mysql connector/net 6.9.9
2) mysql for visual studio 1.2.6
3) mysql connector odbc 5.3.6.

我能做什么?

推荐答案

我遵循了互联网上大多数建议的解决方案,但很抱歉都失败了.出现问题是因为 Visual Studio 缺少 MySql 连接器,我已经通过安装 mysql-connector-net-7.0.4 (https://downloads.mysql.com/archives/c-net/)

I followed most suggested solutions in the internet but for sorry all were failed. The problem occurs because visual studio lacks for MySql connector and I have solved it by installing mysql-connector-net-7.0.4 (https://downloads.mysql.com/archives/c-net/)

这篇关于具有不变名称“MySql.Data.MySqlClient"的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)