The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file mysql mysql

The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file


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/)


It works for me with the following section in 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" />    </DbProviderFactories></system.data> 


I didn't have any MySql connector installed ony my machine.Fixed it by installing nuget: MySql.ConnectorNET.Entity

enter image description here