'Method 'Create' in type - EntityFreamwork 5.0
See original GitHub issueI use EntityFramework in my project and I also use PostgreSQL. I updaated EFCore 5.0 I did After doing Microsoft.EntityFrameworkCore.Relational Version : 5.0, I got the following error.
My project .csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Npgsql" Version="4.1.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spark.External.Manager\Spark.External.Manager.csproj" />
<ProjectReference Include="..\Sparks.External.Core\Spark.External.Core.csproj" />
</ItemGroup>
</Project>
`System.TypeLoadException: ‘Method ‘Create’ in type ‘Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlSqlTranslatingExpressionVisitorFactory’ from assembly ‘Npgsql.EntityFrameworkCore.PostgreSQL, Version=3.1.4.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7’ does not have an implementation.’
System.TypeLoadException HResult=0x80131522 Message=Method ‘Create’ in type ‘Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlSqlTranslatingExpressionVisitorFactory’ from assembly ‘Npgsql.EntityFrameworkCore.PostgreSQL, Version=3.1.4.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7’ does not have an implementation. Source=Npgsql.EntityFrameworkCore.PostgreSQL StackTrace: at Microsoft.Extensions.DependencyInjection.NpgsqlServiceCollectionExtensions.AddEntityFrameworkNpgsql(IServiceCollection serviceCollection) at Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.NpgsqlOptionsExtension.ApplyServices(IServiceCollection services) at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services) at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_0.<GetOrAdd>g__BuildServiceProvider|3() at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_0.<GetOrAdd>b__2(Int64 k) at System.Collections.Concurrent.ConcurrentDictionary
2.GetOrAdd(TKey key, Func
2 valueFactory) at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, Boolean providerRequired) at Microsoft.EntityFrameworkCore.DbContext…ctor(DbContextOptions options) at Spark.External.Core.DataSource.PostgresDbContext…ctor(DbContextOptions1 options) in D:\Git\Sparks.External\Sparks.External.Core\DataSource\PostgresDbContext.cs:line 12
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
You’re mixing EF 3.1.4 and 5.0, so the error is expected. Please wait for the provider and the driver releases from us, it may take some time, but may happen today.
@JulioPablo EntityFrameworkCore.Postgresql 5.0 has been released on 15 of November.