Skip to content

Migrate from .NET 7 to .NET 9 - #53

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781285193-migrate-dotnet-9
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781285193-migrate-dotnet-9

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Migrates the entire solution from .NET 7 to .NET 9 — all project files, NuGet dependencies, Docker images, and CI workflow.

TargetFramework: net7.0net9.0 in all 6 .csproj files.

NuGet packages updated to .NET 9–compatible stable versions:

  • EF Core suite (Microsoft.EntityFrameworkCore.*) → 9.0.17
  • Npgsql suite → 9.0.4/9.0.5
  • Microsoft.AspNetCore.OpenApi9.0.17
  • AspNetCore.HealthChecks.NpgSql9.0.0
  • Swashbuckle.AspNetCore 6.5.06.9.0
  • Mapster 7.3.07.4.0
  • Test packages: FakeItEasy8.3.0, xunit2.9.3, xunit.runner.visualstudio2.8.2, Microsoft.NET.Test.Sdk17.12.0, coverlet.collector6.0.4

Dockerfile: base images aspnet:7.0 / sdk:7.0aspnet:9.0 / sdk:9.0.

CI workflow (.github/workflows/dotnet.yml):

  • dotnet-version: 6.0.x9.0.x
  • actions/checkout@v3v4, actions/setup-dotnet@v3v4

global.json added to pin SDK 9.0.100 with rollForward: latestMinor.

Build and all 20 tests pass locally on .NET 9.0.315.

Link to Devin session: https://app.devin.ai/sessions/02b2753ec8aa4e37903031e3141ded4c
Requested by: @detectiveharree


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

- Update TargetFramework to net9.0 in all 6 csproj files
- Update NuGet packages to .NET 9 compatible versions:
  - EF Core packages → 9.0.17
  - Npgsql packages → 9.0.4/9.0.5
  - ASP.NET Core OpenApi → 9.0.17
  - AspNetCore.HealthChecks.NpgSql → 9.0.0
  - Swashbuckle.AspNetCore → 6.9.0
  - Mapster → 7.4.0
  - FakeItEasy → 8.3.0
  - xunit → 2.9.3, xunit.runner.visualstudio → 2.8.2
  - Microsoft.NET.Test.Sdk → 17.12.0
  - coverlet.collector → 6.0.4
- Update Dockerfile base images to .NET 9.0
- Update GitHub Actions workflow: dotnet-version 9.0.x, checkout@v4, setup-dotnet@v4
- Add global.json to pin SDK version 9.0.100 with latestMinor rollForward

Co-Authored-By: harrison.reeves <harrisonreeves00@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread src/WebApi/WebApi.csproj
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🚩 Swashbuckle.AspNetCore may have compatibility concerns with .NET 9

Swashbuckle.AspNetCore was dropped as the default OpenAPI provider in .NET 9 templates in favor of the built-in Microsoft.AspNetCore.OpenApi. The PR updates Swashbuckle to version 6.9.0 (src/WebApi/WebApi.csproj:16). While recent Swashbuckle versions do work with .NET 9, the project is now in maintenance-only mode. The PR already includes Microsoft.AspNetCore.OpenApi 9.0.17 as a dependency but Program.cs still uses AddSwaggerGen()/UseSwagger()/UseSwaggerUI(). Worth verifying that v6.9.0 is a valid published version and considering whether to migrate to the built-in OpenAPI support.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread src/WebApi/WebApi.csproj
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.10">
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🚩 AspNetCore.HealthChecks.NpgSql v9.0.0 may have breaking API changes

The AddNpgSql health check call in src/WebApi/Program.cs:16 passes a raw connection string as the first argument. In newer major versions of the AspNetCore.HealthChecks.NpgSql package (8.0+), the API signature changed to use NpgsqlDataSource or configuration callbacks instead of raw connection strings. If this overload was removed in v9.0.0, the build will fail. This would be caught by the compiler, but is worth verifying before merge to avoid CI surprises.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants