fix: align EF Core packages with net8.0 target framework (#760)#767
Conversation
…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.
Adversarial Self-ReviewWhat was changed
Items verified
Known observations — not blocking
Edge cases considered
|
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.14to8.0.14acrossTaskdeck.InfrastructureandTaskdeck.Api. - Replace
Microsoft.AspNetCore.Http2.3.9PackageReference in Infrastructure with aFrameworkReferencetoMicrosoft.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.
Adversarial Review (Round 2)Completeness -- all EF Core references verifiedAudited all 10
All 5 references are at 8.0.14. No test projects have direct EF Core references (they inherit transitively). No Breaking changes -- none found
FrameworkReference swap -- correct
Migration snapshot metadata -- not blocking (acknowledged in self-review)3 migration Designer files and Bot findingsGemini (gemini-code-assist) -- valid finding, now fixed:
Copilot -- no findings. Reviewed 3/3 files, generated no comments. Build and test results
VerdictPR is sound. The EF Core version alignment is complete and correct. The one bot finding (PrivateAssets on Design package) has been addressed. |
Summary
Microsoft.AspNetCore.Http2.3.9 NuGet reference from Infrastructure; replace withFrameworkReferencetoMicrosoft.AspNetCore.App(correct pattern for net8.0 class libraries)RelationalEventId.PendingModelChangesWarningsuppression fromDependencyInjection.cs(API does not exist in EF Core 8)OpenTelemetry.Instrumentation.Httpstays at 1.15.0 because 1.15.1 does not exist on NuGet for that package — the version drift is upstream, not a local issueTest plan
dotnet restore backend/Taskdeck.slnsucceedsdotnet build backend/Taskdeck.sln -c Releasesucceeds (0 errors)dotnet test backend/Taskdeck.sln -c Release -m:1passes (3341 passed, 2 skipped, 0 failed)Closes #760