Upgrade from .NET 7 to .NET 9 - #71
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: harrison.reeves <harrisonreeves00@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| <PackageReference Include="Npgsql" Version="7.0.4" /> | ||
| <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" /> | ||
| <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="7.0.4" /> | ||
| <PackageReference Include="Npgsql" Version="9.0.3" /> |
There was a problem hiding this comment.
🔴 Docker database requests always fail
With Npgsql 9, Docker Compose still passes the removed IntegratedSecurity option. Every database-backed API request returns an internal-server error.
Prompt for agents
The Npgsql 9 upgrade in src/Infrastructure/Infrastructure.csproj is incompatible with docker-compose.yml, whose ConnectionStrings__DefaultConnection still contains IntegratedSecurity=true. Npgsql 9 rejects that keyword before opening PostgreSQL, so EducationRepository operations fail in the documented Docker setup. Update the Compose connection string to use Npgsql 9-supported PostgreSQL keywords while preserving the existing host, port, database, username, password, and pooling settings.
Was this helpful? React with 👍 or 👎 to provide feedback.
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.10"> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" /> |
There was a problem hiding this comment.
🟡 Database migrations reject the model
EF Core 9 rebuilds the seeded record with a new identifier each time. Migration commands reject the resulting model as an uncommitted change.
Prompt for agents
The EF Core 9 upgrade in src/Infrastructure/Infrastructure.csproj activates pending-model-change validation, but SampleDbContext.OnModelCreating seeds Education with Guid.NewGuid(). The generated identifier never matches SampleDbContextModelSnapshot, so migration commands such as database update fail before applying migrations. Make the seeded identifier deterministic and keep it aligned with the existing migration and snapshot; verify migration creation and database update against EF Core 9.
Was this helpful? React with 👍 or 👎 to provide feedback.
| ## ASP.NETCore Web API Sample | ||
|
|
||
| This repository is a sample ASP.NET Core Web API (.NET 7) project. | ||
| This repository is a sample ASP.NET Core Web API (.NET 9) project. |
| FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base | ||
| WORKDIR /app | ||
| EXPOSE 5000 | ||
|
|
||
| FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
| FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build |
| <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.10" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.10"> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.8" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.8"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="Npgsql" Version="7.0.4" /> | ||
| <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" /> | ||
| <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="7.0.4" /> | ||
| <PackageReference Include="Npgsql" Version="9.0.3" /> | ||
| <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" /> | ||
| <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="9.0.4" /> |
There was a problem hiding this comment.
Summary
Modernizes the solution from .NET 7 (EOL) to .NET 9:
<TargetFramework>net7.0</TargetFramework>→net9.0Microsoft.EntityFrameworkCore*9.0.8,Npgsql9.0.3,Npgsql.EntityFrameworkCore.PostgreSQL[.NodaTime]9.0.4)Microsoft.AspNetCore.OpenApi9.0.8,AspNetCore.HealthChecks.NpgSql9.0.0,Swashbuckle.AspNetCore7.2.0aspnet:7.0/sdk:7.0→ 9.0; CI workflowdotnet-version6.0.x → 9.0.x; README updatedNo source code changes were required. Verified locally:
dotnet build -c Releasesucceeds and all 20 tests pass on net9.0.Link to Devin session: https://app.devin.ai/sessions/7ffd6426ff5b43388c348c0d459dd00e
Requested by: @detectiveharree
Note
Devin errored when opening this Pull Request as detectiveharree.
As a fallback, Devin opened this PR as itself.
Devin Review