Bug #70758 | MySql Connector Targetting wrong namespace for EF6 | ||
---|---|---|---|
Submitted: | 28 Oct 2013 23:29 | Modified: | 7 Nov 2013 20:32 |
Reporter: | Travis J | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 6.7.4 | OS: | Any |
Assigned to: | Fernando Gonzalez.Sanchez | CPU Architecture: | Any |
Tags: | EF6, entityframework, namespace |
[28 Oct 2013 23:29]
Travis J
[1 Nov 2013 18:57]
Fernando Gonzalez.Sanchez
Hi, Thanks for your bug report, currently Connector/NET 6.7.4 supports EF5 (for .NET 4) and EF 4.3 (for .NET 3.5). There are no plans to support EF 6 on Cnet 6.7.4, but... We are fully supporting EF 6 in Connector/NET 6.8 (6.8.0 alpha is already out).
[5 Nov 2013 22:38]
Travis J
Is 6.8 going to be different than 6.8 alpha? I reproduced this on 6.8 alpha when attempting to use the connector with EF6. Looking at the reference signature for 6.8 alpha shows the provider is still inheriting from the deprecated namespace and as a result causes an exception when any attempt to use the provider is used.
[6 Nov 2013 0:01]
Fernando Gonzalez.Sanchez
Hi Travis, Thanks for your feedback, First of all, please note that the packages for Connector/NET available at Nuget are not official (someone from the community is in charge of them, not Oracle). This is important because the Cnet 6.8 Installer takes care of some important setup steps. Entity Framework 6 introduced a new way to register new EF providers, the way using DbProviderServices is considered the legacy way. In Connector/NET 6.8 we are supporting both - EF5 (with the legacy way and assembly MySql.Data.Entity.EF5.dll) - EF6 (with the new way and assembly MySql.Data.Entity.EF6.dll). For the new way to work in DbFirst for example you need to - Add EF6 nuget package - Add a reference to MySql.Data.Entity.EF6.dll - Modify the app.config to register the MySql provider, like <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"></provider> </providers> </entityFramework> - Now you add a new edmx model, run the wizard for db first, and will work.
[6 Nov 2013 0:04]
Fernando Gonzalez.Sanchez
Travis, If you need, I can send you by mail a sample project on how to use EF6 with the new configuration method. Regards.
[7 Nov 2013 20:32]
Travis J
Thank you for the correction Fernando! I believe I had incorrectly used the provider definition inside of the config file (I think I omitted the .EF6 suffix in the type attribute). I am able to confirm that the connector is now working for me with EF6.
[26 Nov 2013 9:29]
Detlef Martin
Hi! I have done exactly what you have said. I have installed EF6, Connector 6.8.1, added references to my project and modified app.config. After trying to insert a new Entity Model I get the following message: no provider found for EF6. It would be nice of you to provide an example project with working EF6 and a working connector. regards Adam
[26 Nov 2013 17:04]
Fernando Gonzalez.Sanchez
Hi, We are going to produce a tutorial in the blog. In the meantime I think you are missing compiling the project (rebuild); that will copy to bin/debug (or bin/release) the referenced assemblies EntityFramework.dll and MySql.Data.Entity.EF6.dll together with the updated app.config file, which you changed to register the MySql EF6 provider. Regards.