Net Core3.1 目前MySql.Data.EntityFrameworkCore 8.0.18驱动包不兼容的问题

最近Core3.1的更新让大家开始逐渐使用多起来了,但是坑还是不少,网上相关资料却也很少,这里给大家分享一下使用MqSql的一个常见问题。

 错误内容:Method 'get_Info' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.18.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.

相信使用的同学会越来越多的遇到这个问题,那么是因为目前MySql.Data.EntityFrameworkCore 8.0.18不支持Core3.1,建议大家使用Pomelo.EntityFrameworkCore.MySql驱动包;

不过Pomelo.EntityFrameworkCore.MySql驱动包目前使用也是有坑的,就是在使用Migration迁移的时候;就会出现:Change your migrations assembly by using DbContextOptionsBuilder. E.g. options.UseSqlServer(connection, b => b.MigrationsAssembly("Project.API")). By default, the migrations assembly is the assembly containing the DbContext.  

猜你喜欢

转载自www.cnblogs.com/TSir/p/12152354.html