I need to start a Windows Forms project using C#
and Entity Framework 6
(Database First) since I have the MySQL
database ready.
I have searched a lot and have seen multiple posts here on Stackoverflow
and other, (Like this, this and this) but nothing solved my problem, and here is my problem :
I added the EntityFramework plugin (Ver 6.2.0)
with the MySql.Data (Ver 8.0.15)
and MySql.Data.Entity (Ver 7.0.7-ms61)
plugins in order, i also installed MySql for Visual Studio (Ver 1.2.8)
and MySql Connector Net (Ver 8.0.15)
and when I select my database and check that the connection is successfully established... I get this error message :
"Your project references the latest version of Entity Framework; however, an Entity Framework database provider compatible with this version could not be found for your data connection. Exit this wizard, install a compatible provider, and rebuild your project before performing this action".
I tried all different versions of every plugin i am adding but no luck, If i downgrade the EF version form 6 to 5... I get this message :
"Your project references an older version on Entity Framework, To use the latest version, exit this wizard and upgrade before preforming this action."
Even If i continue with this action and clicked Next, nothing will show up or happen.
My App.config
file after I have added all the plugins looks like this :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value=" v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=7.0.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider></providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.15.0" newVersion="8.0.15.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
And I tried replacing the <entityFramework>
tag with this :
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
But nothing is working, I am also rebuilding after every new thing that I try, is there someone able to help me please...