CloudFoundry .NET 5.0 上的 Steeltoe Postgres 连接器

问题描述

我正在使用 Steeltoe.CloudFoundry.Connector.EFCore 和 Npgsql.EntityFrameworkCore.Postgresql。我想将应用程序迁移到 .NET 5.0。将 Npgsql 更新到 5.0.2 后,我收到错误消息“无法找到 DbContextOptionsBuilder,您是否缺少 Postgresql EntityFramework 核心程序集?”添加 DBContext 时。

我试图查看 Steeltoe 的可用版本,但我看到的最高 NuGet 是 2.5.2,这给了我这个错误以及我所拥有的旧版本 (2.4.4)。

这些库的版本组合是否有效?

解决方法

The name of that Steeltoe package changed in 3.0,您将需要 Steeltoe.Connector.EFCore 继续前进。

Npgsql.EntityFrameworkCore.PostgreSQL 中特定类型的名称在 5.0 中发生了变化,这就是 Steeltoe 无法找到它的原因。此修复程序也已应用于 2.x 分支并包含在 2.5.3 版本中。

检查 Steeltoe Samples 存储库的 2.x3.x 版本