efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Method 'get_Info' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore' does not have an implementation

Open khteh opened this issue 7 years ago • 26 comments

I have upgraded the SDK and runtime to 3.0, upgraded the packages in .csproj but bump into the exception:

System.TypeLoadException: Method 'get_Info' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.17.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.

Notice the spelling error in the namespace, Infraestructure instead of Infrastructure. Could that be the root cause?

Steps to reproduce

$ dn --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  19.04
 OS Platform: Linux
 RID:         ubuntu.19.04-x64
 Base Path:   /usr/share/dotnet-3.0.100/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  3.0.100 [/usr/share/dotnet-3.0.100/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet-3.0.100/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet-3.0.100/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Further technical details

EF Core version: 3.0 Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) MySql.Data.EntityFrameworkCore Target framework: .NET Core 3.0 Operating system: Ubuntu 19.04 IDE: Visual Studio Code 1.38.1

khteh avatar Sep 12 '19 08:09 khteh

The MySql provider must also be updated.

ErikEJ avatar Sep 12 '19 08:09 ErikEJ

I am already using the latest 8.0.17 according to https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/

khteh avatar Sep 12 '19 08:09 khteh

But it must be updated for EF Core 3.0 due to breaking changes

ErikEJ avatar Sep 12 '19 08:09 ErikEJ

What do you mean?

khteh avatar Sep 12 '19 09:09 khteh

https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core.html Have to wait then!?

khteh avatar Sep 12 '19 10:09 khteh

You would need to wait until the package author publishes a version which is compatible with EF Core 3.0. EF Core 3 is major release which contains breaking changes and each database provider need to react to it. Closing as this is external issue. Please contact the author of the package you are trying to use.

smitpatel avatar Sep 24 '19 18:09 smitpatel

I tried downgrade Microsoft.EntityFrameworkCore to 2.2.6 but the exception persists.

khteh avatar Sep 25 '19 02:09 khteh

Share your csproj file. You need to use versions for 2.2 for all asp.net packages. Just downgrading EFCore package will not get you anything.

smitpatel avatar Sep 25 '19 05:09 smitpatel

Forget it. Too much unnecessary work. Either wait for donkey years before Oracle works it out or switch to https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/797

khteh avatar Sep 25 '19 06:09 khteh

We should downgrade from EFCore 3.0 to 2.2 ??

ifew avatar Sep 27 '19 11:09 ifew

@ifew - You will need to wait for MySQL provider which works with EF Core 3.0. Till that is released, you would need to stick to version 2.2

smitpatel avatar Sep 27 '19 16:09 smitpatel

has been reported here as well: https://bugs.mysql.com/bug.php?id=97000

hamid-unifi avatar Oct 15 '19 20:10 hamid-unifi

THIS SUCKS!!!!

j0nimost avatar Dec 04 '19 13:12 j0nimost

Note that version 3.0 of the Pomelo MySQL provider has already been released, so this problem should no longer occur. If anyone is still running into issues, please open a new issue on the Pomelo repository.

roji avatar Dec 04 '19 13:12 roji

MySql.Data.EntityFrameworkCore release new version 8.0.19, The situation has not changed.

yuhao-git-star avatar Jan 15 '20 07:01 yuhao-git-star

@yasuoyuhao and others, just to clarify the current situation... There are two MySQL providers for Entity Framework Core:

  • The official one from MySQL: MySql.Data.EntityFrameworkCore. As of now, the latest version is 8.0.19, and works with Entity Framework Core 2.1 (and probably also 2.2). Since EF Core 3.0 is a major version with breaking changes, you cannot use it with this provider.
  • The Pomelo provider: Pomelo.EntityFrameworkCore.MySql. There is a 3.1 version of this provider.

In other words, if you want to use EF Core 3.0/3.1 with MySQL, at this point you need to use the Pomelo provider (or wait for the official MySQL one to get released).

Note that neither of these are provided by the EF team or tracked by this repo - any bugs or feature requests must be filed directly with its respective project.

roji avatar Jan 15 '20 09:01 roji

try out these steps:

  1. you need to remove all entity framework packages ( ex: EntityFrameworkCore.SqlServer or EntityFramework.Tools ).
  2. Now Reinstall MySql.EntityFramework.Core

remember that Entity framework packages can be conflicts with other Entity framework packages so try one at a time and remove another because somtimes dot.net core provide preinstalled EntityFramework.Core.SqlServer

rsmastersoft95 avatar Jan 21 '20 18:01 rsmastersoft95

This is listed as the official package on Microsoft's site:

https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql

scubakiz avatar Jan 29 '20 01:01 scubakiz

@scubakiz Can you point to where this is linked as an "official package"?

ajcvickers avatar Jan 29 '20 16:01 ajcvickers

This is Microsoft's list of Database Providers for .Net Core:

https://docs.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli

There are multiple options for MySQL available.

scubakiz avatar Jan 29 '20 17:01 scubakiz