[Solved] Entity Framework MySQL MVC: Unrecognized element providers exception

Adnaan
 
on Mar 18, 2018 09:47 AM
4139 Views

Hi,

Today I tried using the Entity Framework with MySQL in my ASP.Net MVC Project.

When it runs I get error.

Unrecognized element 'providers'

Please help.

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Mudassar
 
on Mar 18, 2018 09:48 AM

This error comes when you use Entity Framework version 5 with MySQL.

You can simply comment out the Provider section, rebuild and then run the project.

  <entityFramework>
    <!--<providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
    </providers>-->
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v13.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>