将MYSQL与asp.net core连接时出错 问题

将MYSQL与asp.net core连接时出错 问题,mysql,repository-pattern,asp.net-core-2.0,Mysql,Repository Pattern,Asp.net Core 2.0,我正在尝试将SQL与我的asp.net core 2.0 web应用程序连接起来。但我明白了这个错误 程序集“MySql.Data.EntityFrameworkCore,Version=6.10.4.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d”中类型“MySql.Data.EntityFrameworkCore.Infrastructure.Internal.MySQLOptionsExtension”中的方法“Clone”没有实现 我正

我正在尝试将SQL与我的asp.net core 2.0 web应用程序连接起来。但我明白了这个错误

程序集“MySql.Data.EntityFrameworkCore,Version=6.10.4.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d”中类型“MySql.Data.EntityFrameworkCore.Infrastructure.Internal.MySQLOptionsExtension”中的方法“Clone”没有实现

我正在使用asp.net core 2.0和EF 2.0中的存储库模式

startup.cs 这里发生了错误

services.AddDbContext<MyContext>(options => 
            options.UseMySQL(
                Configuration.GetConnectionString("DefaultConnection"),
                b=>b.MigrationsAssembly("AspNetCoreMultipleProject")
                ));
services.AddDbContext(选项=>
options.UseMySQL(
Configuration.GetConnectionString(“DefaultConnection”),
b=>b.MigrationsAssembly(“AspNetCoreMultipleProject”)
));

看起来这可能是因为官方MySQL提供程序不支持EF core 2.0-


建议的解决方法是使用Pomelo provider-

看起来你不能在这个库中使用“克隆”方法任何对我有帮助的东西。我第一次使用带有asp.net核心的mysql,我已经搜索了很多,但没有找到任何好的东西。你能提供发生此错误的代码吗?@majita question Updated我将其更改为UseMySql,但现在它显示此错误>“无法连接到任何指定的mysql主机。”