Update all dependencies and .NET to version 9.0 #254
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.
Overview
This PR updates the entire solution from .NET 6.0 (which is now out of support) to .NET 9.0, the latest stable version. All NuGet packages have been updated to their latest compatible versions.
Motivation
.NET 6.0 reached end of support and is no longer receiving security updates. The build system was showing warnings:
Additionally, many packages were using versions from 2022 and needed to be brought up to date.
Changes Made
Target Framework Updates
All four projects have been updated:
DIDemo(main web application)DIDemoServices(service library)DIDemo.Tests(unit tests)DIDemo.Services.Tests(service tests)Updated from
net6.0→net9.0Package Updates
Main Application (DIDemo):
6.0.7→9.0.16.0.0→9.0.16.0.7→9.0.1Services Library (DIDemoServices):
6.0.0→9.0.113.0.1→13.0.3Test Projects:
17.2.0→17.12.02.2.10→3.7.0Code Modernization
Updated
Program.csto use the modern .NET hosting pattern:Before:
After:
This aligns with the recommended .NET hosting model while maintaining full compatibility with the existing
Startupclass pattern.Verification
✅ All projects build successfully with zero warnings
✅ All unit tests pass (2/2 test projects)
✅ No breaking changes to existing functionality
✅ Minimal code changes - only version updates and hosting modernization
Benefits
Migration Notes
This update is fully backward compatible with the existing codebase. No changes are required to existing services, controllers, or business logic. The Dependency Injection patterns demonstrated in this repository continue to work identically in .NET 9.0.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.