I have a similar problem as the one presented in the question No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'
If you get this error on Visual Studio while debugging, this happens after you installed another DB provider or IDE with DB Provider. I faced this error after I installed Delphi on my computer.
Solution: Just edit C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config and remove tags.
Wow...that is pretty special...Anyways. You need to register the Entity Framework provider for the System.Data.SqlClient
SQL connection type.
You want to add the following to your app.config
/web.config
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlClient" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Simply install "MySql.Data.Entity" from nuget! It will install mysql ado driver and entity driver automatically!
I got this error but for me it was something entirely different.
I had to edit:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
And:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
Searching for DbProviderFactories
both configs looked like this:
<system.data>
<DbProviderFactories>
<add name="IBM DB2 for i .NET Provider" invariant="IBM.Data.DB2.iSeries" description=".NET Framework Data Provider for IBM i" type="IBM.Data.DB2.iSeries.iDB2Factory, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26" />
</DbProviderFactories>
<DbProviderFactories />
</system.data>
When I removed the trailing <DbProviderFactories />
everything started working again.
I was able to solve it by looking at only Unable to find the requested .Net Framework Data Provider
and finding this answer:
https://stackoverflow.com/a/9929534/3850405
Try adding
var _ = System.Data.Entity.SqlServer.SqlProviderServices.Instance;
in the ctor of your designContext.
Still not sure what was causing the problem, but ended up creating a new solution and copying everything from my project. Now works fine. Really weird, indeed.