问题
I created a console app and use EntityFramework 6.2 (for connection with MS SQL), MySql.Data 8.0.11 and MySql.Data.Entity 6.10.7 (for connection with MySQL).
In this application I want to create a job like an SQL job but I don't want to use quertz.net. I have error:
"Attempt by method 'MySql.Data.Entity.EFMySqlCommand.set_DbConnection(System.Data.Common.DbConnection)' to access method 'MySql.Data.MySqlClient.MySqlConnection.get_Settings()' failed."
回答1:
MySql.Data.Entity 6.10.7 isn't compatible with MySql.Data 8.0.11.
Oracle renamed the package to MySql.Data.EntityFramework for v8.x. You need to uninstall MySql.Data.Entity and install MySql.Data.EntityFramework.
回答2:
They broth thanks, you saved my life. I have lost more than 5 hour trying to figure out what was happening. guys don't forget to put on your database Context.
[DbConfigurationType(typeof(MySql.Data.EntityFramework.MySqlEFConfiguration))]
来源:https://stackoverflow.com/questions/50216643/error-attempt-by-method-x-set-dbconnectionsystem-data-common-dbconnection-to