Skip to content

Conversation

dcabib
Copy link

@dcabib dcabib commented Sep 9, 2025

Hey team! I implemented the .NET 6 deprecation as requested in #749. Since .NET 6 is out of support and AWS Lambda is dropping it in October, I cleaned up all the dual-targeting mess we had.

What I did:

Fixed the targeting:

  • I updated both Directory.Build.props files to only target net8.0 (removed net6.0;net8.0)
  • Found 4 e2e test projects that were still trying to build for .NET 6 and fixed those too

Cleaned up the code:

  • I nuked all 7 #if NET6_0 blocks across the codebase
  • I simplified the #if NET8_0_OR_GREATER blocks that had fallback code for .NET 6
  • For example, that MD5 hash thing in BasePersistenceStore now just uses MD5.Create() instead of the old HashAlgorithm.Create() fallback

Updated docs:

  • I went through README, docs, and all the example READMEs to change ".NET 6" mentions to ".NET 8"
  • Updated the roadmap to mark this as done

Testing:

I ran the full test suite - all 703 unit tests pass! Build is clean too. The e2e tests fail but that's because of missing Lambda functions in the cloud, not our changes.

Breaking change heads up:

Yeah, this is breaking. If you're still on .NET 6, you'll need to upgrade your projects to .NET 8. But honestly, you should be doing that anyway since .NET 6 is EOL.

Just change your <TargetFramework>net6.0</TargetFramework> to <TargetFramework>net8.0</TargetFramework> and install .NET 8. No API changes needed.

Fixes #749

- Remove net6.0 from TargetFrameworks in Directory.Build.props files
- Remove all #if NET6_0 conditional compilation blocks
- Simplify #if NET8_0_OR_GREATER blocks by removing .NET 6 fallback code
- Update documentation to reflect .NET 8 only support
- Fix e2e test projects that were still targeting .NET 6

All 703 core unit tests pass. Breaking change: .NET 6 projects need to upgrade to .NET 8.

Fixes aws-powertools#749
@boring-cyborg boring-cyborg bot added area/idempotency area/logging Core logging utility area/metrics Core metrics utility documentation Improvements or additions to documentation tests labels Sep 9, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 9, 2025
@hjgraca hjgraca changed the title Deprecate .NET 6 support chore: Deprecate .NET 6 support Sep 9, 2025
@github-actions github-actions bot added the internal Maintenance changes label Sep 9, 2025
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.34%. Comparing base (ec874c0) to head (7e7e81e).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #987      +/-   ##
==========================================
- Coverage   73.46%   73.34%   -0.13%     
==========================================
  Files         203      203              
  Lines        8190     8174      -16     
  Branches      879      877       -2     
==========================================
- Hits         6017     5995      -22     
- Misses       1881     1888       +7     
+ Partials      292      291       -1     
Flag Coverage Δ
unittests 73.34% <ø> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hjgraca
Copy link
Contributor

hjgraca commented Sep 9, 2025

Thank you @dcabib will look into it shortly.

@hjgraca
Copy link
Contributor

hjgraca commented Sep 9, 2025

@dani-abib thank you, after reviewing there are a couple of things missing in the pull request:

  • Some #if NET8_0_OR_GREATER are still present like here
  • Some #elif NET6_0 still present, like here
  • rename <TargetFrameworks>net8.0</TargetFrameworks> to <TargetFramework>net8.0</TargetFramework> (singular)

@hjgraca hjgraca self-requested a review September 9, 2025 14:59
- Remove ALL remaining #if NET8_0_OR_GREATER blocks and their #endif pairs
- Remove #elif NET6_0 blocks from test files
- Change TargetFrameworks to TargetFramework (singular) since we only target one framework
- Clean up orphaned #endif directives that caused compilation errors

Build now succeeds with 0 errors, only warnings remain.
@boring-cyborg boring-cyborg bot added the area/tracing Core tracing utility label Sep 9, 2025
Copy link

sonarqubecloud bot commented Sep 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/idempotency area/logging Core logging utility area/metrics Core metrics utility area/tracing Core tracing utility documentation Improvements or additions to documentation internal Maintenance changes size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants