tolga
tolga

Reputation: 2810

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.

Upvotes: 7

Views: 6440

Answers (1)

tolga
tolga

Reputation: 2810

Solved.

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

dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 3.1.0

Upvotes: 12

Related Questions