-
I'm trying to replace MySql.Data.MySqlClient with MySqlConnector in .Net Framework and Web Apps, using EF 6.4.4. The apps - Console and Web apps alike - target .Net Framework 4.6.1. Per https://mysqlconnector.net/overview/dbproviderfactories/ , I've made the appropriate replacement, and modified my app to call When I run the app, I get the error
If I add a section as shown below, I get the error:
This suggests to me that the class When using MySql.Data.MySqlClient instead of MySqlConnector, the correct provider appears to be:
(Correct type is 'MySql.Data.MySqlClient.MySqlProviderServices', which is different than the type in the associated DbProdiverFactories type of just MySql.Data.MySqlClient) I don't see anything in the class hierarchy of MySqlConnector that jumps out at me as the correct type to use in the tag. Anyone know what I'm doing wrong here, and how to fix it so that EF6 is happy? Here is the relevant section of app.config in my .Net Framework app (Note that I'm using the same type - MySqlConnector.MySqlConnectorFactory - for both the and DbProviderFactories tags because I don't know what else to use for the tag):
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The error message identifies the problem: There is no EF6 support in MySqlConnector. If you're using EF6, the only option is If you can migrate to EF Core, then you can use Pomelo.EntityFrameworkCore.MySql which supports EF Core 7. (Note that EF7 requires .NET 6, but EF Core 3.1.x can run on .NET Framework 4.6.1; however, it may be unsupported.) |
Beta Was this translation helpful? Give feedback.
The error message identifies the problem: There is no EF6 support in MySqlConnector. If you're using EF6, the only option is
MySql.Data.EntityFramework
withMySql.Data
. (As far as I know, there is no way to use the Oracle EF implementation with the MySqlConnector ADO.NET implementation.)If you can migrate to EF Core, then you can use Pomelo.EntityFrameworkCore.MySql which supports EF Core 7. (Note that EF7 requires .NET 6, but EF Core 3.1.x can run on .NET Framework 4.6.1; however, it may be unsupported.)