.NET Core MySql TypeLoadException - Method Clone

0

I'm trying to make a .NET Core 2.0 console application work with a MySQL database using Entity Framework.

I've tried both the Oracle ( https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/ ) and Pomelo ( https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql ) connectors and both of them throw a TypeLoadException:

Oracle Exception:

System.TypeLoadException occurred
  HResult=0x80131522
  Message=Method 'Clone' in type 'MySQL.Data.EntityFrameworkCore.Infraestructure.Internal.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.
  Source=<Cannot evaluate the exception source>
  StackTrace:
   at MySQL.Data.EntityFrameworkCore.Extensions.MySQLDbContextOptionsExtensions.UseMySQL(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 MySQLOptionsAction)
   at Common.DAL.MyContext.OnConfiguring(DbContextOptionsBuilder optionsBuilder) in Program.cs:line 18
   at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.get_Model()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
...

Pomelo Exception:

{System.TypeLoadException: Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Internal.MySqlOptionsExtension' from assembly 'Pomelo.EntityFrameworkCore.MySql, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at Microsoft.EntityFrameworkCore.MySqlDbContextOptionsExtensions.UseMySql
   at Common.DAL.MyContext.OnConfiguring(DbContextOptionsBuilder optionsBuilder) in Program.cs:line 18
   at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.get_Model()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
...
mysql
oracle
entity-framework
.net-core
asked on Stack Overflow Sep 2, 2017 by Timo89

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0