Skip to content

.NET Framework compatibility update - #318

Open
sliedig wants to merge 5 commits into
aws:masterfrom
sliedig:sliedig/framework-upd
Open

.NET Framework compatibility update#318
sliedig wants to merge 5 commits into
aws:masterfrom
sliedig:sliedig/framework-upd

Conversation

@sliedig

@sliedig sliedig commented Jul 30, 2025

Copy link
Copy Markdown

Issue #, if available: #315

Description of changes:

Overview

This PR updates the AWS X-Ray Recorder SDK for .NET to support the latest recommended target frameworks while maintaining backward compatibility. The changes align with current Microsoft support policies and provide users with access to the latest performance improvements and security updates.

Target Framework Changes

  • Previous: net6.0;netcoreapp3.1;netstandard2.0;net462;net45
  • Updated: net8.0;netcoreapp3.1;netstandard2.0;net481

Key Updates:
✅ Upgraded .NET 6.0 → .NET 8.0 (latest LTS version)
✅ Upgraded .NET Framework 4.62/4.5 → .NET Framework 4.8.1 (latest supported version)
✅ Maintained .NET Core 3.1 for backward compatibility
✅ Maintained .NET Standard 2.0 for broad ecosystem support
✅ Updated the GitHub build system to match new targets.

Technical Changes

Conditional Compilation Updates

  • Replaced all net6.0 references with net8.0 in conditional ItemGroups
  • Updated net45 and net462 references to net481
  • Updated compound conditions (e.g., '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net8.0')

Package Reference Updates

  • Entity Framework: Added EF Core 8.0 support for .NET 8.0 target
  • ASP.NET Core: Updated FrameworkReference conditions to include .NET 8.0
  • System References: Updated .NET Framework references for 4.8.1 compatibility

File Exclusion Logic

  • Updated conditional compilation to properly exclude/include framework-specific files
  • Maintained separation between .NET Framework and .NET Core/Standard implementations

Breaking Changes

None - This is a non-breaking change that maintains full backward compatibility while adding support for newer frameworks.

Benefits

🚀 Performance: Access to .NET 8.0 performance improvements and optimizations
🔒 Security: Latest security patches and updates from .NET 8.0 and .NET Framework 4.8.1
🛠️ Developer Experience: Support for latest C# language features and tooling
📦 Future-Proof: Alignment with Microsoft's current support lifecycle
🔄 Compatibility: Maintains support for existing applications on older frameworks

Migration Path

Existing applications can continue using the library without any code changes. To take advantage of the new target frameworks:

  • For .NET 8.0: Upgrade your application to target .NET 8.0
  • For .NET Framework 4.8.1: Upgrade your application to target .NET Framework 4.8.1
  • Existing applications: Continue using .NET Core 3.1 or .NET Standard 2.0 targets without changes

Justification for removing unsupported frameworks

I removed unsupported targets (e.g., net452, net462, netcoreapp2.0, net6.0) to align with Microsoft support, reduce security risk and CI instability, and focus maintenance on platforms that receive fixes. The SDK now targets net8.0, netcoreapp3.1, netstandard2.0, and net481; netstandard2.0 preserves broad compatibility for many older apps. If you can’t upgrade yet, please pin to a previous SDK release. This shift improves performance, reliability, and security for supported platforms.

This update ensures the AWS X-Ray Recorder SDK stays current with Microsoft's supported frameworks while maintaining the stability and compatibility that existing users depend on.

Additionally, no new functionality has been introduced. This is primarily a compatibility update with modern frameworks. New functionality will be focused on OTel.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sliedig sliedig changed the title Sliedig/framework upd .NET Framwork compatibility update Aug 8, 2025
@sliedig
sliedig marked this pull request as ready for review August 8, 2025 01:46
@sliedig
sliedig requested a review from a team as a code owner August 8, 2025 01:46
@sliedig sliedig changed the title .NET Framwork compatibility update .NET Framework compatibility update Aug 18, 2025


#if NETFRAMEWORK
#if !NET8_0

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.

Why is NET8_0 excluded for the test? What about NET9_0?


aws cloudwatch put-metric-data \
--metric-name "$METRIC_NAME" \
--dimensions "failure=rate,framework=${{matrix.version}},os=${{matrix.os}}" \

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.

It is great to get clearer information with more metrics dimensions. However, CloudWatch metrics treat different set of dimensions as different time series data. Please also publish old metrics to keep backward compatibility.


aws cloudwatch put-metric-data \
--metric-name "$METRIC_NAME" \
--dimensions "failure=rate,framework=${{matrix.version}},os=${{matrix.os}}" \

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.

Same metrics dimension issue as above.

Comment thread .github/workflows/ci.yml
dotnet --list-runtimes

# Verify required SDKs are installed
if ! dotnet --list-sdks | grep -q "3.1"; then

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.

Comment thread .github/workflows/ci.yml
exit 1
fi

if ! dotnet --list-sdks | grep -q "8.0"; then

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.

Same as above. This line might fail in workflow run.

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.

Not sure why this workflow requires any change.

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