Hey,
In my startup code of an aspnetcore app (netcoreapp3.0 preview) I have the following code:
services.AddDbContext<ApplicationDbContext>(b => b.UseMySql(Configuration.GetConnectionString("DefaultConnection")));
I am getting the following exception:
System.TypeLoadException: Method 'PopulateDebugInfo' in type 'Pomelo.EntityFrameworkCore.MySql.Infrastructure.Internal.MySqlOptionsExtension' from assembly 'Pomelo.EntityFrameworkCore.MySql, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at Microsoft.EntityFrameworkCore.MySqlDbContextOptionsExtensions.UseMySql
at Edited.Web.Startup.<ConfigureServices>b__4_1(DbContextOptionsBuilder b) in C:\Users\edited\Edited.Web\Startup.cs:line 34
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass1_0`2.<AddDbContext>b__0(IServiceProvider p, DbContextOptionsBuilder b)
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.DbContextOptionsFactory[TConte
xt](IServiceProvider applicationServiceProvider, Action`2 optionsAction)
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass10_0`1.<AddCoreServices>b__0(IServiceProvider p)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
...
MySQL version: MariaDB 10.1
Operating system: Windows 10
Pomelo.EntityFrameworkCore.MySql version: 2.2.0
Microsoft.AspNetCore.App version: 3.0.0-preview3.19128.7
@mguinness I am very sorry, I tried to find something similar but somehow missed it.
@queil Getting the same error here. Experimenting with EFCore 3.0.0.-preview3.19153.1 and MySql.Data.EntityFrameworkCore 8.0.15.
Had to switch to EFCore 2.2.3 to work again.
@tzographos: Well, as @mguinness pointed out (linking to to #740) - this is not supported and won't be supported until NET Core 3.0 is GA.
NET Core 3.0
@tzographos: Well, as @mguinness pointed out (linking to to #740) - this is not supported and won't be supported until NET Core 3.0 is GA.
Is NET Core 2.2 also not supported now? Use the 2.2 Getting the same error
Also getting the same error on 2.2.
in version 2.1 its work
You need to use a database provider that is compatible with the EF Core version you are using:
EF Core | Pomelo.EntityFrameworkCore.MySql
-- | --
2.2.0 | 2.2.0
2.2.6 | 2.2.6-rc2 (prerelease)
3.0.0 | 3.0.0-rc1 (prerelease)
Most helpful comment
You need to use a database provider that is compatible with the EF Core version you are using:
EF Core | Pomelo.EntityFrameworkCore.MySql
-- | --
2.2.0 | 2.2.0
2.2.6 | 2.2.6-rc2 (prerelease)
3.0.0 | 3.0.0-rc1 (prerelease)