1

Problem

I am trying to conect MY SQL with my asp.net core 2.0 web application. But it throug me this error

Method 'Clone' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.Internal.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=6.10.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.

I am using Repository pattern in asp.net core 2.0 with EF 2.0

startup.cs

here the error occurs

services.AddDbContext<MyContext>(options => 
            options.UseMySQL(
                Configuration.GetConnectionString("DefaultConnection"),
                b=>b.MigrationsAssembly("AspNetCoreMultipleProject")
                ));
4
  • looks like you can't use the "clone" method with this library Commented Dec 5, 2017 at 11:58
  • any thing which helps me. I am using mysql with asp.net core very first time and I already searched a lot but not find any thing good Commented Dec 5, 2017 at 12:00
  • Can you include the code where this error is occurring? Commented Dec 5, 2017 at 12:54
  • @majita question updated Commented Dec 6, 2017 at 6:45

1 Answer 1

1

It looks like this could be because the official MySQL provider doesn't work with EF core 2.0 - GitHub issue.

The suggested workaround is to use the Pomelo provider - MS documentation

Sign up to request clarification or add additional context in comments.

1 Comment

I changed it to UseMySql but now it show me this error > "Unable to connect to any of the specified MySQL hosts."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.