I'm working on an ASP.NET Core project using Entity Framework Core and Npgsql for PostgreSQL. I'm trying to create a DbContext
to manage my database, but I'm encountering the following error when I try to add a migration or run the application:
Unable to create a 'DbContext' of type 'RuntimeType'. The exception 'Method 'GetDatabaseLock' in type 'Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlHistoryRepository' from assembly 'Npgsql.EntityFrameworkCore.PostgreSQL, Version=9.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' does not have an implementation.' was thrown while attempting to create an instance.
I've confirmed that all my Entity Framework Core and Npgsql packages are on version 9.x, but the issue persists. The following includes a list of what I have tried to fix the issue
Upgrading to 9.0.2
for Npgsql.EntityFrameworkCore.PostgreSQL
solved for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With