No Entity Framework provider found for 'MySql.Data.MySqlClient' ADO.NET provider

前端 未结 11 740
青春惊慌失措
青春惊慌失措 2020-11-29 04:45

I\'m trying to use Entity Framework with MySQL and I get the above error. I have the latest MySQL connector installed.

The full error reads:

No Entit         


        
11条回答
  •  时光说笑
    2020-11-29 05:04

    in EF5 or less, all ok. in EF6, you need to use mysql connector 6.8.x, and add DbConfigurationTypeAttribute to you DbContext:

    [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
    public class DemoContext : DbContext{}
    

    which MySqlEFConfiguration is in MySql.Data.Entity.EF6.dll in 6.8.x. Have a try!

提交回复
热议问题