Home >Database >Mysql Tutorial >Why Does \'EFMySqlCommand.set_DbConnection\' Fail to Access \'MySqlConnection.get_Settings()\'?
Compatibility Error: EFMySqlCommand Accessing MySqlConnection Settings
In a console application utilizing EntityFramework 6.2 for MS SQL and MySql.Data for MySQL connection, an error occurs during the creation of a custom job:
"Attempt by method 'MySql.Data.Entity.EFMySqlCommand.set_DbConnection(System.Data.Common.DbConnection)' to access method 'MySql.Data.MySqlClient.MySqlConnection.get_Settings()' failed."
Resolution:
This error stems from a compatibility issue between MySql.Data.Entity 6.10.7 and MySql.Data 8.0.11. Oracle has renamed the package to MySql.Data.EntityFramework for v8.x and beyond.
To resolve this, follow these steps:
Once the correct package is installed, the application should function without the error.
The above is the detailed content of Why Does \'EFMySqlCommand.set_DbConnection\' Fail to Access \'MySqlConnection.get_Settings()\'?. For more information, please follow other related articles on the PHP Chinese website!