Search code examples
postgresqlentity-framework-corenpgsql.net-5steeltoe

Steeltoe Postgres connector on CloudFoundry .NET 5.0


I am using Steeltoe.CloudFoundry.Connector.EFCore with Npgsql.EntityFrameworkCore.PostgreSQL. I want to migrate the application to .NET 5.0. After updating Npgsql to 5.0.2 I am getting the error 'Unable to find DbContextOptionsBuilder, are you missing a PostgreSql EntityFramework Core assembly?' when adding DBContext.

I tried to look at the available versions of Steeltoe, but the highest NuGet I see is 2.5.2, which gives me this error as well as the older I had (2.4.4).

Is there any version combination of those libraries that works?


Solution

  • The name of that Steeltoe package changed in 3.0, you'll be needing Steeltoe.Connector.EFCore going forward.

    The name of that particular type inside Npgsql.EntityFrameworkCore.PostgreSQL changed in 5.0, so that's what is preventing Steeltoe from finding it. The fix has also been applied to the 2.x branch and is included in version 2.5.3.

    Check the Steeltoe Samples repo for both 2.x and 3.x versions