question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Method 'Create' in type - EntityFreamwork 5.0

See original GitHub issue

I 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.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
YohDeadfallcommented, Nov 10, 2020

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.

4reactions
vonzshikcommented, Feb 9, 2021

@JulioPablo EntityFrameworkCore.Postgresql 5.0 has been released on 15 of November.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeLoadException: Method 'Create' in type ... does not ...
Basically, the error message means that Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.
Read more >
What's New in EF Core 5.0
EF Core 5.0 supports many-to-many relationships without explicitly mapping the join table. For example, consider these entity types:.
Read more >
Getting Started With Entity Framework Core 5 | The .NET ...
EF Core 5 applies an approach known as Table-per-hierarchy (TPH), where we store hierarchically related entities in a single table. Each ...
Read more >
Entity Framework Core 5 - Pitfalls To Avoid and Ideas to Try
In this post, we'll look at some pitfalls and ideas EF Core users like yourself may want to consider when developing an application....
Read more >
Calling Stored Procedures with the Entity Framework in . ...
Type in the following command to add the Entity Framework to the project. ... In this first sample, build a stored procedure without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found