"MySql. Data. MySqIClient. MySqlProviderSevices" violates the inherited security rules. The derived type must match the Security accessibility of the base type or be less secure than the base type. "Solution,
When writing Code First (using the MySql database), add EntityFrame, MySql. Data, MySql. Data. Entity, and write the TestDbContext class.
When running the command, "MySql. Data. MySqIClient. MySqlProviderSevices" is returned, which violates the inherited security rules. The derived type must match the Security accessibility of the base type or be less secure than the base type. "
A few hours later, Baidu found that there was a problem with the latest version (6.10.4) of MySql. Data and MySql. Data. Entity.
The following versions of errors are reported:
Install-package EntityFramework Version 6.2.0MySql.Data Version 6.10.4MySql.Data.Entity Version 6.10.4
Just change to the following version:
Install-package EntityFramework Version 6.2.0MySql.Data Version 6.9.10MySql.Data.Entity Version 6.9.10