Fix playground apps after Npgsql 9 update#7045
Conversation
| <ProjectReference Include="..\TestShop.ServiceDefaults\TestShop.ServiceDefaults.csproj" /> | ||
|
|
||
| <!-- Npgsql EF needs to match the same major version as the underlying Npgsql assemblies. --> | ||
| <PackageReference Include="Npgsql.DependencyInjection" VersionOverride="$(Npgsql8Version)" /> |
There was a problem hiding this comment.
NIT: should we consider doing the override in a single place (like a directory.build.props so all of these testshop projects can benefit) and that way we reduce the number of places that need to be updated come .net 10?
There was a problem hiding this comment.
We should only override the PackageRefernce if the app is also referencing Npgsql EF Core. There are only a handful of playground apps use it. We can't do it in a single place without affecting the projects that don't want it.
The real problem here is transitive pinning. Since most projects want Npgsql v9, we use that in our Directory.Packages.props (even when targeting net8 - see #6946). But when an app is targeting net8 -> it needs EF Core 8. And if it uses EF Core 8 -> it needs Ngpsql 8.
joperezr
left a comment
There was a problem hiding this comment.
Left only NITs, non are blocking, more just questions, so this LGTM.
Npgsql EF requires a matching major version with the Npgsql version being used. There are breaking changes between major versions that don't allow Npgsql EF 8 to load with Npgsql 9, and vice versa. Workaround this by ensuring that whenever we use Npgsql EF we use a matching Npgsql version.
cfe46ea to
565f11c
Compare
Npgsql EF requires a matching major version with the Npgsql version being used. There are breaking changes between major versions that don't allow Npgsql EF 8 to load with Npgsql 9, and vice versa.
Workaround this by ensuring that whenever we use Npgsql EF we use a matching Npgsql version.
It looks like the playground tests were disabled in Improve auto-forwarding for GitHub Codespaces and devcontainers. (dotnet/aspire#6780).