-
Notifications
You must be signed in to change notification settings - Fork 0
Modernize: Update to .NET 10 and fix minor issues #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gunnbr
wants to merge
26
commits into
master
Choose a base branch
from
feature/modernize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e052ec3
Update to .NET 10
gunnbr d741ad3
Update to latest version of EFCore.
gunnbr d30efe1
Update to latest Gthx.Data submodule
gunnbr fb1cb30
Update Dockerfile now that this is a .NET 10 console application.
gunnbr 349d66e
Add container for SQL server to run unit tests
gunnbr e239f6a
Remove and sort usings
gunnbr 7d65015
Update Gthx.Data.
gunnbr 1dce6de
Start SQL server container to run unit tests
gunnbr cea5e36
Fix usage of obsolete Serilog method.
gunnbr ba26923
Remove stray character in comment
gunnbr 0d36045
Fix wait for SQL server initialization
gunnbr 6f32370
Use dynamic SQL container port in test fixture
Copilot 1098dca
Add MockGthxUtil so tests can pass without a real internet connection.
gunnbr 582a645
Merge branch 'feature/modernize' of https://github.com/gunnbr/GthxNet…
gunnbr c315dd5
Reduce scope of tests that require SQL Server container
gunnbr ab03a14
Fix check for SQL server readiness
gunnbr 4ebbd21
Remove 'insiders' from VS Version
gunnbr dcceca9
Fix service registration so things work properly.
gunnbr 1fce459
Merge branch 'feature/modernize' of https://github.com/gunnbr/GthxNet…
gunnbr 7cf2b4f
Fix automated test setup to initialize the DB correcly.
gunnbr f3476cd
Fix async handling for getting webpage titles
gunnbr d876090
Switch back to DB selection via appsettings as originally intended.
gunnbr 92a6c13
Switch back to non-console mode to run live tests in IRC.
gunnbr 7f14b66
Fix typos in README
gunnbr 3d2b70b
Properly dispost of the host when it exits.
gunnbr 9207d79
Mark EntityFrameworkCore.Design as a private asset
gunnbr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
.github/upgrades/scenarios/dotnet-version-upgrade/assessment.csv
Large diffs are not rendered by default.
Oops, something went wrong.
2,121 changes: 2,121 additions & 0 deletions
2,121
.github/upgrades/scenarios/dotnet-version-upgrade/assessment.json
Large diffs are not rendered by default.
Oops, something went wrong.
531 changes: 531 additions & 0 deletions
531
.github/upgrades/scenarios/dotnet-version-upgrade/assessment.md
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
.github/upgrades/scenarios/dotnet-version-upgrade/execution-log.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
|
|
||
| ## [2026-04-14 10:13] 01-update-target-frameworks | ||
|
|
||
| All project files were updated to target .NET 10. Ambiguous LINQ Where calls in both the main data and test projects were resolved by explicitly using System.Linq.Queryable. The solution now builds successfully, completing the target framework upgrade step. | ||
|
|
||
|
|
||
| ## [2026-04-14 11:40] 02-update-nuget-packages | ||
|
|
||
| All NuGet packages were upgraded to the latest stable versions compatible with .NET 10. Package conflicts were resolved, and the solution builds successfully after a clean build. No preview or dev packages were used. Pomelo.EntityFrameworkCore.MySql was upgraded to 9.0.0 for EF Core 10 compatibility. Serilog and related dependencies were aligned to latest stable versions. Manual intervention was not required for any package. | ||
|
|
||
|
|
||
| ## [2026-04-14 13:41] 03-refactor-console-app-di | ||
|
|
||
| The console app was refactored to use the Generic Host DI pattern. All DI registrations are now in ConfigureServices, logging uses UseSerilog, and configuration is loaded via the host builder. The solution builds successfully and is ready for validation and testing. | ||
|
|
||
|
|
||
| ## [2026-04-14 21:03] 04-address-api-incompatibilities | ||
|
|
||
| All code compiles, all tests (except the intentionally ignored Thingiverse test) pass, and no upgrade-related runtime errors remain. No unresolved API or behavioral incompatibilities were detected after the .NET 10 upgrade. | ||
|
|
||
|
|
||
| ## [2026-04-14 21:04] 05-validation-and-testing | ||
|
|
||
| All tests were run and validated. 29 out of 30 tests passed; the only failure is an intentionally ignored Thingiverse test. The solution is stable and validated for .NET 10. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # .NET Version Upgrade Plan | ||
|
|
||
| ## Overview | ||
|
|
||
| **Target**: Upgrade all projects in the solution to .NET 10 and refactor the main console application to use the Generic Host pattern for dependency injection. | ||
| **Scope**: 7 projects, moderate complexity, includes DI refactor for console app and package updates. | ||
|
|
||
| ## Tasks | ||
|
|
||
| ### 01-update-target-frameworks | ||
|
|
||
| Update the target framework for all projects from .NET 6 to .NET 10. This ensures compatibility with the latest .NET features and long-term support. | ||
|
|
||
| **Done when**: All project files target net10.0 and build successfully. | ||
|
|
||
| --- | ||
|
|
||
| ### 02-update-nuget-packages | ||
|
|
||
| Upgrade all NuGet packages to the latest compatible versions, replacing deprecated packages as needed. This addresses security, compatibility, and support issues flagged in the assessment. | ||
|
|
||
| **Done when**: No deprecated or outdated packages remain, and all projects restore successfully. | ||
|
|
||
| --- | ||
|
|
||
| ### 03-refactor-console-app-di | ||
|
|
||
| Refactor the main console application to use the Generic Host pattern for dependency injection, configuration, and logging. Remove any legacy ASP.NET or ad-hoc DI patterns, ensuring a clean, modern setup. | ||
|
|
||
| **Done when**: The console app starts via Generic Host, all services are registered and resolved via DI, and the app runs as expected. | ||
|
|
||
| --- | ||
|
|
||
| ### 04-address-api-incompatibilities | ||
|
|
||
| Resolve any source or behavioral incompatibilities identified in the test projects or elsewhere due to the .NET 10 upgrade. Update code to use supported APIs and adjust for breaking changes. | ||
|
|
||
| **Done when**: All code compiles, tests pass, and no upgrade-related runtime errors remain. | ||
|
|
||
| --- | ||
|
|
||
| ### 05-validation-and-testing | ||
|
|
||
| Run all unit and integration tests, validate application behavior, and perform manual smoke testing. Ensure the upgraded solution is stable and ready for production use. | ||
|
|
||
| **Done when**: All tests pass and the application functions as expected in .NET 10. |
17 changes: 17 additions & 0 deletions
17
.github/upgrades/scenarios/dotnet-version-upgrade/scenario-instructions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # .NET Version Upgrade | ||
|
|
||
| ## Strategy | ||
| Sequential upgrade: frameworks → packages → DI refactor → compatibility fixes → validation. | ||
|
|
||
| ## Preferences | ||
| - **Flow Mode**: Automatic | ||
| - **Commit Strategy**: After Each Task | ||
| - **Pace**: Standard | ||
| - **Target Framework**: net10.0 | ||
| - **Working Branch**: upgrade-to-NET10 | ||
|
|
||
| ## Decisions | ||
| - Upgrade all projects to .NET 10 (LTS) | ||
| - Refactor console app to use Generic Host DI | ||
|
|
||
| ## Custom Instructions |
18 changes: 18 additions & 0 deletions
18
.github/upgrades/scenarios/dotnet-version-upgrade/scenario.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "scenarioId": "dotnet-version-upgrade", | ||
| "operationId": "b7ee4606-3fda-4047-a863-d0e1fa2e8ca1", | ||
| "description": "Upgrade .NET projects to newer .NET versions", | ||
| "startTime": "2026-04-14T16:53:23.0421221Z", | ||
| "lastUpdateTime": "2026-04-15T04:03:37.7123426Z", | ||
| "stage": "Assessment", | ||
| "properties": { | ||
| "task:04-address-api-incompatibilities:startedAt": "2026-04-15T04:03:37.7123426Z", | ||
| "task:05-validation-and-testing:startedAt": "2026-04-14T20:41:31.5260263Z", | ||
| "currentTask": "04-address-api-incompatibilities", | ||
| "UpgradeTargetFramework": "net10.0", | ||
| "task:03-refactor-console-app-di:startedAt": "2026-04-14T18:38:10.8027901Z", | ||
| "task:02-update-nuget-packages:startedAt": "2026-04-14T17:16:08.9878623Z", | ||
| "task:01-update-target-frameworks:startedAt": "2026-04-14T17:08:41.6858892Z" | ||
| }, | ||
| "folderPath": "" | ||
| } |
15 changes: 15 additions & 0 deletions
15
.github/upgrades/scenarios/dotnet-version-upgrade/tasks.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # .NET Version Upgrade Progress | ||
|
|
||
| ## Overview | ||
|
|
||
| This upgrade will move all projects to .NET 10, update all NuGet packages, refactor the main console app to use the Generic Host DI pattern, resolve API incompatibilities, and validate with tests. The approach is sequential: frameworks first, then packages, then DI refactor, then compatibility fixes, then validation. | ||
|
|
||
| **Progress**: 5/5 tasks complete (100%)  | ||
|
|
||
| ## Tasks | ||
|
|
||
| - ✅ 01-update-target-frameworks: Update all project target frameworks to .NET 10 | ||
| - ✅ 02-update-nuget-packages: Upgrade all NuGet packages and replace deprecated ones | ||
| - ✅ 03-refactor-console-app-di: Refactor console app to use Generic Host DI | ||
| - ✅ 04-address-api-incompatibilities: Resolve API and behavioral incompatibilities | ||
| - ✅ 05-validation-and-testing: Run and validate all tests | ||
5 changes: 5 additions & 0 deletions
5
...ades/scenarios/dotnet-version-upgrade/tasks/01-update-target-frameworks/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 01-update-target-frameworks: Update Target Frameworks | ||
|
|
||
| Update the target framework for all projects from .NET 6 to .NET 10. This ensures compatibility with the latest .NET features and long-term support. | ||
|
|
||
| **Done when**: All project files target net10.0 and build successfully. |
5 changes: 5 additions & 0 deletions
5
...pgrades/scenarios/dotnet-version-upgrade/tasks/02-update-nuget-packages/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 02-update-nuget-packages: Update NuGet Packages | ||
|
|
||
| Upgrade all NuGet packages to the latest compatible versions, replacing deprecated packages as needed. This addresses security, compatibility, and support issues flagged in the assessment. | ||
|
|
||
| **Done when**: No deprecated or outdated packages remain, and all projects restore successfully. |
5 changes: 5 additions & 0 deletions
5
...rades/scenarios/dotnet-version-upgrade/tasks/03-refactor-console-app-di/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 03-refactor-console-app-di: Refactor Console App DI | ||
|
|
||
| Refactor the main console application to use the Generic Host pattern for dependency injection, configuration, and logging. Remove any legacy ASP.NET or ad-hoc DI patterns, ensuring a clean, modern setup. | ||
|
|
||
| **Done when**: The console app starts via Generic Host, all services are registered and resolved via DI, and the app runs as expected. |
5 changes: 5 additions & 0 deletions
5
...scenarios/dotnet-version-upgrade/tasks/04-address-api-incompatibilities/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 04-address-api-incompatibilities: Address API Incompatibilities | ||
|
|
||
| Resolve any source or behavioral incompatibilities identified in the test projects or elsewhere due to the .NET 10 upgrade. Update code to use supported APIs and adjust for breaking changes. | ||
|
|
||
| **Done when**: All code compiles, tests pass, and no upgrade-related runtime errors remain. |
5 changes: 5 additions & 0 deletions
5
...grades/scenarios/dotnet-version-upgrade/tasks/05-validation-and-testing/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 05-validation-and-testing: Validation and Testing | ||
|
|
||
| Run all unit and integration tests, validate application behavior, and perform manual smoke testing. Ensure the upgraded solution is stable and ready for production use. | ||
|
|
||
| **Done when**: All tests pass and the application functions as expected in .NET 10. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | ||
| FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build | ||
| WORKDIR /source | ||
|
|
||
| # copy and publish app and libraries | ||
| COPY . . | ||
| RUN dotnet publish -c release -o /app | ||
|
|
||
| # final stage/image | ||
| FROM mcr.microsoft.com/dotnet/aspnet:6.0 | ||
| FROM mcr.microsoft.com/dotnet/runtime:10.0 | ||
| WORKDIR /app | ||
| COPY --from=build /app . | ||
| ENTRYPOINT ["dotnet", "GthxNetBot.dll"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Use the official Microsoft SQL Server 2022 image as the base | ||
| FROM mcr.microsoft.com/mssql/server:2022-latest AS sql | ||
|
|
||
| # Install .NET SDK | ||
| FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build | ||
|
|
||
| # Set environment variables for SQL Server | ||
| ENV SA_PASSWORD=Your_password123 | ||
| ENV ACCEPT_EULA=Y | ||
| ENV MSSQL_PID=Express | ||
|
Comment on lines
+7
to
+10
|
||
|
|
||
| # Copy the SQL Server binaries from the sql image | ||
| COPY --from=sql /opt/mssql /opt/mssql | ||
|
Comment on lines
+12
to
+13
|
||
|
|
||
| # Expose SQL Server port | ||
| EXPOSE 1433 | ||
|
|
||
| # Create a working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy your solution and test project files | ||
| COPY . . | ||
|
|
||
| # Copy wait-for-sql script and make it executable | ||
| COPY wait-for-sql.sh /wait-for-sql.sh | ||
| RUN chmod +x /wait-for-sql.sh | ||
|
|
||
| # Restore and build your test project (adjust path as needed) | ||
| RUN dotnet restore | ||
| RUN dotnet build --configuration Release | ||
|
|
||
| # Start SQL Server in the background, wait for it to be ready, then run tests | ||
| CMD /opt/mssql/bin/sqlservr & \ | ||
| /wait-for-sql.sh && \ | ||
| dotnet test --no-build --logger:trx | ||
|
Comment on lines
+1
to
+35
Comment on lines
+24
to
+35
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Gthx.Data
updated
5 files
| +1 −1 | Gthx.Core/Gthx.Core.csproj | |
| +4 −5 | Gthx.Data/Gthx.Data.csproj | |
| +7 −8 | Gthx.Data/GthxSqlData.cs | |
| +2 −2 | MariaDbMigrations/MariaDbMigrations.csproj | |
| +1 −1 | SqlServerMigrations/SqlServerMigrations.csproj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.