3

I'm trying to use mysql with Microsoft.EntityFrameworkCore 2.1-rc-final and MySql.Data.EntityFrameworkCore 8.0.11 as provider. But when I'm trying to execute the mugrations command i get this exception: System.MissingMethodException: Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommandBuilderFactory..ctor(Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger`1, Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.

This is my IDesignTimeDbContextFactory code implementation:

public class DesignLocationFactory:IDesignTimeDbContextFactory<LocationDbContext>
{
    public LocationDbContext CreateDbContext(string[] args)
    {
        var builder = new DbContextOptionsBuilder<LocationDbContext>();
            builder.UseMySQL("server=localhost;port=3306;user=***;passsword=***;database=locationdb");
        return new LocationDbContext(builder.Options);
    }
}

Please how can I fix this or at least some sample of how to use with another providers

Yosel
  • 41
  • 1
  • 4

2 Answers2

1

Finally, with this provider Pomelo.EntityFrameworkCore.MySql version 2.1.0-rc1-final everything works perfect. To install it execute the command: Install-Package Pomelo.EntityFrameworkCore.MySql -Version 2.1.0-rc1-final

Yosel
  • 41
  • 1
  • 4
1

I can confirm that 2.1.0-rc1-final resolves this issue. Also, take note of Pomelo's case sensitivity vs Microsoft.EntityFrameworkCore.

Pomelo = UseMySql (Sql)

EntityFrameworkCore = UseMySQL (SQL)

Using Core 2.1

Id                                           Versions
--                                           --------
Microsoft.AspNetCore.App                     {2.1.0}
Microsoft.VisualStudio.Web.CodeGeneration.Design {2.1.0}
Microsoft.EntityFrameworkCore.Tools          {2.1.0}
Microsoft.NETCore.App                        {2.1.0}
MySql.Data.EntityFrameworkCore.Design        {8.0.11}
MySql.Data.EntityFrameworkCore               {8.0.11}
Pomelo.EntityFrameworkCore.MySql             {2.1.0-rc1-final}
Gregory Bologna
  • 270
  • 1
  • 6
  • 20