Method 'Create' does not have an implementation in .Net Core 3
I'm trying create model from existing database and I have error:
Method 'Create' in type 'Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.NpgsqlDatabaseModelFactory' from assembly 'Npgsql.EntityFrameworkCore.PostgreSQL, Version=3.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' does not have an implementation.
Table:
CREATE TABLE public.test
(
id serial NOT NULL,
name text COLLATE pg_catalog."default" NOT NULL,
created timestamp with time zone NOT NULL DEFAULT now(),
CONSTRAINT test_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;
Npgsql.EntityFrameworkCore.PostgreSQL version 3.0.0-preview1
You're likely trying to mix different versions of the Npgsql provider and EF Core itself. Make sure all versions are aligned, and if the error persists, please post your csproj.
csproj here
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0-rc1.19456.14">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.0.0-preview1" />
</ItemGroup>
</Project>
Result of command "dotnet ef dbcontext scaffold --version" is 3.0.0-rc1.19456.14
You're trying to use Npgsql.EntityFrameworkCore.PostgreSQL 3.0.0-preview1 with Microsoft.EntityFrameworkCore.Design 3.0.0-rc1... Change both to use preview9 (there's no rc1 of the Npgsql provider, we'll publish the release directly early next week).
Worked for me! Thanks @franciscojunior.
Is it possible to make the error message more informative? Something like:
Version mismatch between Npgsql.EntityFrameworkCore.PostgreSQL and Microsoft.EntityFrameworkCore.Design.