Skip to content

Upgrade to .NET 10 LTS - #6

Merged
kris7011 merged 1 commit into
mainfrom
chore/upgrade-dotnet-10
Oct 16, 2026
Merged

kris7011 merged 1 commit into
mainfrom
chore/upgrade-dotnet-10

Conversation

@kris7011

Copy link
Copy Markdown
Owner

Problem

The project targets .NET 9, which reaches end of support on 10 November 2026. After that date there are no security updates for the runtime, ASP.NET Core or EF Core 9. The Dockerfile used the 9.0 images, the SDK version was not pinned (no global.json), and the Docker build was never validated in CI.

Solution

  • Target framework: net9.0 → net10.0 in all six projects. .NET 10 is LTS and supported until 14 November 2028.

  • Packages (aligned with runtime 10.0.13):

    • Microsoft.EntityFrameworkCore, .Sqlite, .Design 9.0.21 → 10.0.13
    • Microsoft.AspNetCore.OpenApi 9.0.21 → 10.0.13
    • Microsoft.AspNetCore.Mvc.Testing 9.0.21 → 10.0.13
    • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.7 → 10.0.13
    • Other dependencies were checked for compatibility and left unchanged: Swashbuckle.AspNetCore 10.2.3 supports net10 (Swagger UI verified), and xunit 2.9.2, the test SDK and coverlet all run on net10.
  • SDK: a new global.json pins SDK 10.0.402 with rollForward: latestFeature. CI reads the version from it (global-json-file) instead of 9.0.x.

  • Docker: sdk:9.0/aspnet:9.0 → sdk:10.0/aspnet:10.0. frontend/ and docs/ are excluded from the build context because the image only contains the API.

  • New CI job, docker:

    • builds the image
    • starts the container and checks /health
    • calls POST /api/demo/reset, which applies EF Core migrations inside the container
    • verifies that the schedule overview returns 14 shifts

    Nothing is pushed to any registry.

  • README: .NET 10, a "Run the API with Docker" section and the Docker job in the CI description. "Docker support" was removed from Future improvements because it already existed.

No application code changed. The upgrade required no code changes and produced no new compiler or analyzer warnings.

Test results

Locally with SDK 10.0.402:

dotnet build -c Release        → 0 warnings, 0 errors
ShiftPlanner.Tests             → 63 passed (net10.0)
ShiftPlanner.Api.IntegrationTests → 29 passed (net10.0, migrations on SQLite)
dotnet list package --vulnerable → no vulnerable packages
frontend: npm run lint → 0 problems · npm test → 8 passed · npm run build → OK

Migrations and functionality:

  • dotnet ef migrations has-pending-model-changes (EF Core 10.0.13 tool) → "No changes have been made to the model since the last migration."
  • Upgrade of an existing database. I started the .NET 10 API against a copy of a SQLite database created by the .NET 9 build. The data was preserved (10 employees, 14 shifts). /health, /swagger/v1/swagger.json (200), schedule generation (7 of 10 open shifts assigned), the overview (coverage 78.57 %, 11 assigned), requiredStaff validation (400) and demo reset all worked.
  • Docker: Docker Desktop could not start on my machine, so the image was not built locally. The new CI job builds and smoke-tests it; see the checks on this PR.

Limitations

  • The container keeps its SQLite database inside the container filesystem, as before. Use a volume if you need persistence.
  • xunit stays on v2. Migrating to xunit v3 is a separate, optional step.

🤖 Generated with Claude Code

.NET 9 reaches end of support in November 2026. .NET 10 is the current
LTS release, supported until November 2028.

- Target net10.0 in all projects
- EF Core, Microsoft.AspNetCore.OpenApi, Mvc.Testing and
  DependencyInjection.Abstractions 10.0.13
- Add global.json pinning the .NET 10 SDK (10.0.402, latestFeature)
  and use it in CI
- Docker images: sdk:10.0 and aspnet:10.0; exclude frontend/ and docs/
  from the build context
- Add a CI job that builds the Docker image and smoke tests the
  container (health, migrations via demo reset, overview)
- README: .NET 10, Docker usage and CI description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kris7011
kris7011 merged commit 3cada0f into main Oct 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant