Skip to content

fix: align EF Core packages with net8.0 target framework (#760)#767

Merged
Chris0Jeky merged 4 commits into
mainfrom
fix/760-ef-core-version-alignment
Apr 4, 2026
Merged

fix: align EF Core packages with net8.0 target framework (#760)#767
Chris0Jeky merged 4 commits into
mainfrom
fix/760-ef-core-version-alignment

Conversation

@Chris0Jeky
Copy link
Copy Markdown
Owner

Summary

  • Pin all EF Core packages (EntityFrameworkCore, .Sqlite, .Design, .Tools) from 9.0.14 to 8.0.14, matching the net8.0 TFM across both Infrastructure and Api projects
  • Remove stale Microsoft.AspNetCore.Http 2.3.9 NuGet reference from Infrastructure; replace with FrameworkReference to Microsoft.AspNetCore.App (correct pattern for net8.0 class libraries)
  • Remove EF Core 9-only RelationalEventId.PendingModelChangesWarning suppression from DependencyInjection.cs (API does not exist in EF Core 8)
  • Note: OpenTelemetry.Instrumentation.Http stays at 1.15.0 because 1.15.1 does not exist on NuGet for that package — the version drift is upstream, not a local issue

Test plan

  • dotnet restore backend/Taskdeck.sln succeeds
  • dotnet build backend/Taskdeck.sln -c Release succeeds (0 errors)
  • dotnet test backend/Taskdeck.sln -c Release -m:1 passes (3341 passed, 2 skipped, 0 failed)
  • CI green on this PR

Closes #760

…Core.Http 2.3.9

Downgrade Microsoft.EntityFrameworkCore, .Sqlite, and .Design from 9.0.14
to 8.0.14 to match the net8.0 TFM. Replace the obsolete
Microsoft.AspNetCore.Http 2.3.9 NuGet reference with a FrameworkReference
to Microsoft.AspNetCore.App (the correct approach for class libraries
targeting net8.0+).
RelationalEventId.PendingModelChangesWarning was introduced in EF Core 9.
With the downgrade to 8.0.14, the API no longer exists and the suppression
is unnecessary. Remove the ConfigureWarnings call and unused Diagnostics using.
Downgrade Microsoft.EntityFrameworkCore.Design and .Tools from 9.0.14 to
8.0.14, aligning with the net8.0 target framework.
Copilot AI review requested due to automatic review settings April 4, 2026 18:24
@Chris0Jeky
Copy link
Copy Markdown
Owner Author

Adversarial Self-Review

What was changed

  1. EF Core 9.0.14 -> 8.0.14 in both Taskdeck.Infrastructure.csproj (3 packages) and Taskdeck.Api.csproj (2 packages)
  2. Removed Microsoft.AspNetCore.Http 2.3.9 from Infrastructure; replaced with <FrameworkReference Include="Microsoft.AspNetCore.App" /> (correct for net8.0 class libraries)
  3. Removed RelationalEventId.PendingModelChangesWarning suppression (EF Core 9-only API) from DependencyInjection.cs

Items verified

  • All 5 EF Core package references across all 10 .csproj files are now at 8.0.14
  • No central package management (Directory.Packages.props) exists — all versions are in-project
  • No global.json constraining SDK versions
  • No Dockerfile references to EF Core tools
  • Build: 0 errors, same warnings as before
  • Tests: 3341 passed, 2 skipped (pre-existing), 0 failed

Known observations — not blocking

  1. Migration snapshot version string: TaskdeckDbContextModelSnapshot.cs and 3 migration Designer files still record ProductVersion: "9.0.14". This is a metadata annotation only — it does not affect runtime behavior. Regenerating the snapshot would create a large diff with no functional benefit. Next migration created will update it to 8.0.14 naturally.
  2. OpenTelemetry.Instrumentation.Http at 1.15.0: The issue asked to align at 1.15.1, but that version does not exist on NuGet for this specific package (latest is 1.15.0). The other 4 OTel packages are at 1.15.1. This is upstream version drift, not a local issue.
  3. Microsoft.Extensions.Logging.Abstractions at 10.0.5: This is a .NET 10 preview package on a net8.0 target — similar misalignment pattern as the original EF Core issue. Out of scope for this PR but worth a follow-up issue.
  4. Swashbuckle.AspNetCore at 10.1.7: Also a major version ahead, but Swashbuckle versions independently of .NET and 10.x supports net8.0. Not an issue.

Edge cases considered

  • The FrameworkReference to Microsoft.AspNetCore.App is the officially recommended replacement for the old Microsoft.AspNetCore.Http NuGet package on .NET 5+. It provides all ASP.NET Core types without version drift.
  • EF Core 8.0.14 is the latest patch of the 8.x line and is the supported version for net8.0 LTS.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request downgrades Entity Framework Core from version 9.0.14 to 8.0.14 across the API and Infrastructure projects. It also removes EF Core 9 specific warning suppressions and cleans up dependencies in the Infrastructure project by adding a framework reference to Microsoft.AspNetCore.App and removing the explicit Microsoft.AspNetCore.Http package. Feedback was provided regarding the Microsoft.EntityFrameworkCore.Design package in the API project, suggesting the addition of PrivateAssets and IncludeAssets metadata to ensure consistency and prevent design-time assets from being included in the published output.

<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.14">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.14" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the Microsoft.EntityFrameworkCore.Tools package in this project and the Microsoft.EntityFrameworkCore.Design reference in the Infrastructure project, it is recommended to include PrivateAssets="all" and IncludeAssets metadata for this package. This ensures that design-time assets are not included in the published output and are not transitively inherited by other projects.

    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.14">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns backend dependency versions with the solution’s net8.0 target, removing unsupported EF Core 9.x usage and an obsolete ASP.NET Core 2.x package reference.

Changes:

  • Downgrade/pin EF Core packages from 9.0.14 to 8.0.14 across Taskdeck.Infrastructure and Taskdeck.Api.
  • Replace Microsoft.AspNetCore.Http 2.3.9 PackageReference in Infrastructure with a FrameworkReference to Microsoft.AspNetCore.App.
  • Remove EF Core 9-only warning suppression (RelationalEventId.PendingModelChangesWarning) from DbContext configuration.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
backend/src/Taskdeck.Infrastructure/Taskdeck.Infrastructure.csproj Drops stale Microsoft.AspNetCore.Http package, adds Microsoft.AspNetCore.App framework ref, pins EF Core packages to 8.0.14.
backend/src/Taskdeck.Infrastructure/DependencyInjection.cs Removes EF Core 9-specific warning suppression and diagnostics using; keeps SQLite registration compatible with EF Core 8.
backend/src/Taskdeck.Api/Taskdeck.Api.csproj Pins EF Core tooling/design packages to 8.0.14 to match net8.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Address Gemini bot review finding: the Design package was missing
PrivateAssets/IncludeAssets, unlike the Tools package and the
matching Design reference in Infrastructure.csproj.
@Chris0Jeky
Copy link
Copy Markdown
Owner Author

Adversarial Review (Round 2)

Completeness -- all EF Core references verified

Audited all 10 .csproj files on the branch. Only 3 projects reference EF Core packages:

Project Package Version
Taskdeck.Api EntityFrameworkCore.Design 8.0.14
Taskdeck.Api EntityFrameworkCore.Tools 8.0.14
Taskdeck.Infrastructure EntityFrameworkCore 8.0.14
Taskdeck.Infrastructure EntityFrameworkCore.Sqlite 8.0.14
Taskdeck.Infrastructure EntityFrameworkCore.Design 8.0.14

All 5 references are at 8.0.14. No test projects have direct EF Core references (they inherit transitively). No Directory.Packages.props, global.json, or nuget.config override versions.

Breaking changes -- none found

  • RelationalEventId.PendingModelChangesWarning removal: correct, this API does not exist in EF Core 8.
  • Microsoft.EntityFrameworkCore.Diagnostics using removal: correct, no other code references this namespace.
  • ConfigureWarnings: no remaining usages anywhere in the codebase.
  • ExecuteDeleteAsync in KnowledgeChunkRepository.cs: EF Core 7+ API, fully available in 8.x. Not a concern.

FrameworkReference swap -- correct

Taskdeck.Infrastructure is an Microsoft.NET.Sdk (non-Web) class library. It uses Microsoft.AspNetCore.Http via UserContext.cs (line 2). The FrameworkReference Include="Microsoft.AspNetCore.App" is the officially recommended approach for net5.0+ class libraries needing ASP.NET Core types.

Migration snapshot metadata -- not blocking (acknowledged in self-review)

3 migration Designer files and TaskdeckDbContextModelSnapshot.cs still record ProductVersion: "9.0.14". This is annotation-only metadata with no runtime effect. The next dotnet ef migrations add will naturally update it to 8.0.14.

Bot findings

Gemini (gemini-code-assist) -- valid finding, now fixed:

  • Taskdeck.Api.csproj:22: Microsoft.EntityFrameworkCore.Design was missing PrivateAssets="all" and IncludeAssets metadata. This was a pre-existing omission (also missing on main), but since this PR touched the line, it was the right place to fix it. Pushed commit 1bf7cc33 to address this.

Copilot -- no findings. Reviewed 3/3 files, generated no comments.

Build and test results

  • dotnet restore / dotnet build -c Release: 0 errors, 12 warnings (all pre-existing)
  • dotnet test -c Release -m:1: 3342 passed, 2 skipped, 0 failed
    • (One flaky timeout in ProposalHousekeepingWorkerEdgeCaseTests.ExecuteAsync_ShouldStopWithinReasonableTime_WhenCancelled on initial run; passed on re-run and in CI. Pre-existing, not related to this PR.)

Verdict

PR is sound. The EF Core version alignment is complete and correct. The one bot finding (PrivateAssets on Design package) has been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

TECH-DEBT: EF Core 9.x used on net8.0 target framework

2 participants