Home >Database >Mysql Tutorial >How to Fix \'Error in Setting DbConnection: MySql.Data.Entity Incompatibility with MySql.Data\'?

How to Fix \'Error in Setting DbConnection: MySql.Data.Entity Incompatibility with MySql.Data\'?

Susan Sarandon
Susan SarandonOriginal
2024-11-02 04:56:02297browse

How to Fix

Error in Setting DbConnection: MySql.Data.Entity Incompatibility with MySql.Data

Consider the following issue: while developing a console app utilizing EntityFramework 6.2 for MS SQL and MySql.Data 8.0.11 for MySQL, a specific job creation error arises. The error message reads, "Attempt by method 'MySql.Data.Entity.EFMySqlCommand.set_DbConnection(System.Data.Common.DbConnection)' to access method 'MySql.Data.MySqlClient.MySqlConnection.get_Settings()' failed."

The culprit behind this error lies in the incompatibility between MySql.Data.Entity 6.10.7 and MySql.Data 8.0.11. This discrepancy stems from Oracle renaming the package to MySql.Data.EntityFramework for versions 8.x onwards.

Resolution:

To rectify this issue, follow these steps:

  1. Uninstall MySql.Data.Entity.
  2. Install MySql.Data.EntityFramework.

The above is the detailed content of How to Fix \'Error in Setting DbConnection: MySql.Data.Entity Incompatibility with MySql.Data\'?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn