MySQL Forums
Forum List  »  MySQL for Visual Studio

Re: How to start using Entity Framework 6 with MySQL databases
Posted by: Edgar Knapp
Date: January 17, 2014 02:46PM

I finally got it to work! The MySQL installer refused to work (first it complained about Commercial components being installed alongside GA ones; I never installed a commercial MySQL component in my life), then after I had removed Connector, Workbench, VS Integration, Notifier, Tools, and what else I could find, it would not update itself ("Update download failed security check" wtf?).

I installed without updating the installer, copied the dll and jumped through a few other hoops (installing EF6 and MySQL for EF6 via Nuget, modifying web.config, building and ignoring the errors). Finally, I was able to generate the DDL for my one-entity data model and run the script in Workbench to create the table. Wow!

So it does work, sort-of, but I would not dare use it for anything but toy projects at this point.

Here is my web.config for reference:

<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<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" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<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>
<connectionStrings>
<add name="Model1Container" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=svctest;user id=root;password=???????;persistsecurityinfo=True;database=test&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to start using Entity Framework 6 with MySQL databases
4784
January 17, 2014 02:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.