Skip to content

feat: Upgrade application from .NET 6 to .NET 10 LTS - #93

Merged
dhelper merged 3 commits into
mainfrom
dotnet10_upgrade
Aug 30, 2026
Merged

dhelper merged 3 commits into
mainfrom
dotnet10_upgrade

Conversation

@PankajRawat333

Copy link
Copy Markdown

Issue #, if available:

Description of changes:

  • Update all projects to target net10.0 via centralized Directory.Build.props
  • Add global.json pinning SDK to 10.0.100 with latestFeature rollForward
  • Migrate AWS SDK from v3 to v4 (AWSSDK.* 4.0.x)
  • Update Entity Framework Core from mixed 5.0/6.0 to 10.0.x
  • Update Amazon.Extensions.Configuration.SystemsManager to v7
  • Update authentication packages to 10.0.x
  • Update test packages (xunit 2.x, Test SDK 17.x, coverlet 6.x)
  • Update Magick.NET to v14, Amazon.CDK.Lib to latest 2.x

Code fixes for .NET 10 and AWS SDK v4 compatibility:

  • Remove deprecated JwtSecurityTokenHandler, use MapInboundClaims=false
  • Remove deprecated ISystemClock from LocalAuthenticationHandler
  • Add null checks for AWS SDK v4 collection properties (default null)
  • Fix nullable reference type annotations on IFileService and implementations
  • Use GetRequiredService and await using for async scopes

Infrastructure updates for Amazon Linux 2023:

  • Switch EC2 AMI from Amazon Linux 2 MATE to Amazon Linux 2023
  • Install .NET 10 runtime via Microsoft package feed
  • Replace make-dummy-cert with openssl for self-signed SSL cert
  • Fix SSL config paths for AL2023 (/etc/pki/tls/)
  • Update bobsbookstore.conf with correct cert/key paths
  • Upgrade TLS protocol to TLSv1.2/TLSv1.3
  • Switch from yum to dnf package manager
  • Update CDK publish path from net6.0 to net10.0
  • Remove unnecessary packages (Microsoft.Build, CodeGeneration.Design)

- Update all projects to target net10.0 via centralized Directory.Build.props
- Add global.json pinning SDK to 10.0.100 with latestFeature rollForward
- Migrate AWS SDK from v3 to v4 (AWSSDK.* 4.0.x)
- Update Entity Framework Core from mixed 5.0/6.0 to 10.0.x
- Update Amazon.Extensions.Configuration.SystemsManager to v7
- Update authentication packages to 10.0.x
- Update test packages (xunit 2.x, Test SDK 17.x, coverlet 6.x)
- Update Magick.NET to v14, Amazon.CDK.Lib to latest 2.x

Code fixes for .NET 10 and AWS SDK v4 compatibility:
- Remove deprecated JwtSecurityTokenHandler, use MapInboundClaims=false
- Remove deprecated ISystemClock from LocalAuthenticationHandler
- Add null checks for AWS SDK v4 collection properties (default null)
- Fix nullable reference type annotations on IFileService and implementations
- Use GetRequiredService and await using for async scopes

Infrastructure updates for Amazon Linux 2023:
- Switch EC2 AMI from Amazon Linux 2 MATE to Amazon Linux 2023
- Install .NET 10 runtime via Microsoft package feed
- Replace make-dummy-cert with openssl for self-signed SSL cert
- Fix SSL config paths for AL2023 (/etc/pki/tls/)
- Update bobsbookstore.conf with correct cert/key paths
- Upgrade TLS protocol to TLSv1.2/TLSv1.3
- Switch from yum to dnf package manager
- Update CDK publish path from net6.0 to net10.0
- Remove unnecessary packages (Microsoft.Build, CodeGeneration.Design)
@dhelper dhelper self-assigned this Aug 23, 2026
@dhelper
dhelper self-requested a review August 23, 2026 06:28

@dhelper dhelper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very good, updated to AL2023 and .NET 10 - some minor comments - careful when returning nullable (see my comments), also try and reduce the build warnings:
CS8618 Non-nullable property/field uninitialized in constructor ~150
CS8601 Possible null reference assignment ~20
CS8603 Possible null reference return ~15
CS8602 Dereference of a possibly null reference ~15
CS8625 Null literal to non-nullable type ~5
CS0618/CS0612 Obsolete API usage (CloudFrontWebDistribution) 3
CS8765/CS8767 Nullability mismatch with overridden/implemented member 4
CS8634/CS8619/CS8622 Generic type nullability constraints ~5

Comment thread app/Bookstore.Data/Bookstore.Data.csproj Outdated
Comment thread app/Bookstore.Domain/Bookstore.Domain.csproj Outdated
Comment thread app/Bookstore.Web/Startup/AuthenticationSetup.cs Outdated
Comment thread app/Bookstore.Web/Startup/ServicesSetup.cs Outdated
Comment thread app/Bookstore.Web/Bookstore.Web.csproj Outdated
Pankaj Rawat added 2 commits August 23, 2026 13:33
…fast config

- Enable C# nullable reference types fully: add `= null!` to EF Core
  navigation properties in all domain entities, fix all CS8618/CS8601/
  CS8602/CS8603/CS8604/CS8619/CS8622/CS8625/CS8765/CS8767 warnings
- Update repository interfaces to return T? (e.g. Task<Order?>) so
  FindAsync/SingleOrDefaultAsync return types flow correctly
- Service layer now throws InvalidOperationException with a meaningful
  message when a required entity is not found (reviewer: "maybe an
  exception with error message would be better here")
- AuthenticationSetup: throw on missing CognitoDomain config instead of
  defaulting to empty string (reviewer: "fail in case configuration is
  missing")
- ServicesSetup: GetDatabaseConnectionString returns string (not string?)
  and throws if no connection string can be resolved
- Remove empty <PropertyGroup> comment blocks from .csproj files
- Fix validation attribute overrides to accept object? parameter
- Fix Razor views to use User.Identity?.IsAuthenticated == true pattern
- Build result: 0 warnings, 0 errors (was ~394 warnings)
- Add = null! to uninitialized CDK stack properties and private fields
  (EC2ComputeStackProps, DatabaseStackProps, CoreStack, EC2ComputeStack)
- Fix nullable default parameters: IStackProps? and string? in constructors
- Migrate CloudFrontWebDistribution (CS0618) to Distribution + S3BucketOrigin
  with Origin Access Control, removing the deprecated OAI-based setup
- Fix CS8601/CS8602 null-forgiving operators on CDK token properties

Build now has 0 warnings across all projects (Domain, Data, Web, Cdk).
@PankajRawat333

Copy link
Copy Markdown
Author

Very good, updated to AL2023 and .NET 10 - some minor comments - careful when returning nullable (see my comments), also try and reduce the build warnings: CS8618 Non-nullable property/field uninitialized in constructor ~150 CS8601 Possible null reference assignment ~20 CS8603 Possible null reference return ~15 CS8602 Dereference of a possibly null reference ~15 CS8625 Null literal to non-nullable type ~5 CS0618/CS0612 Obsolete API usage (CloudFrontWebDistribution) 3 CS8765/CS8767 Nullability mismatch with overridden/implemented member 4 CS8634/CS8619/CS8622 Generic type nullability constraints ~5

Fixed all the warning, mostly related to nullable

@dhelper
dhelper merged commit be2a75b into main Aug 30, 2026
2 checks passed
@dhelper
dhelper deleted the dotnet10_upgrade branch August 30, 2026 06:23
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.

2 participants