Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method 'get_Info' in type Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.NpgsqlOptionsExtension does not have an implementation

New to .Net Core, I started with a WebApi.

I try to migrate my first model to PostgreSQL database. UserModel, UserContext and PostgreSQL settings are ready. When I:

dotnet ef migrations add initial

I get the following error:

Method 'get_Info' in type 'Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.NpgsqlOptionsExtension' from assembly 'Npgsql.EntityFrameworkCore.PostgreSQL, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' does not have an implementation.

Here're my packages:

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.8">
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
  <PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.0" />
<PackageReference Include="NpgSql.EntityFrameworkCore.PostgreSQL.Design" Version="1.1.1" />
</ItemGroup>

dotnet --version:

dotnet --version
5.0.100-preview.2.20176.6

What am I missing? Is this a package version disagreement? Thank you.

like image 982
tolga Avatar asked Jul 22 '26 03:07

tolga


1 Answers

Solved.

EntityFramework version was 3.1, so I installed the same version for PostgreSQL:

dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 3.1.0
like image 186
tolga Avatar answered Jul 24 '26 18:07

tolga



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!