Skip to content

Conversation

@Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented Nov 16, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 16, 2025 15:52
@Tyrrrz Tyrrrz added the enhancement New feature or request label Nov 16, 2025
@Tyrrrz Tyrrrz changed the title Add polyfill for AppContext.TargetFrameworkName and TargetFrameworkAttribute Add polyfills for AppContext.TargetFrameworkName and TargetFrameworkAttribute Nov 16, 2025
Copilot finished reviewing on behalf of Tyrrrz November 16, 2025 15:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds polyfills for AppContext.TargetFrameworkName and TargetFrameworkAttribute to enable their use on older .NET Framework versions that lack these APIs natively. The implementation follows the project's extension pattern to add the TargetFrameworkName property to AppContext on frameworks where it doesn't exist.

Key changes:

  • Implements TargetFrameworkAttribute class for .NET Framework versions prior to 4.0
  • Adds AppContext.TargetFrameworkName property polyfill using the extension pattern for older .NET Framework and .NET Standard versions
  • Includes test coverage to verify the polyfill functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
PolyShim/NetCore10/TargetFrameworkAttribute.cs Adds polyfill for TargetFrameworkAttribute with conditional compilation for pre-.NET 4.0 frameworks
PolyShim/NetCore10/AppContext.cs Adds AppContext.TargetFrameworkName property polyfill with fallback type declaration for frameworks lacking AppContext
PolyShim.Tests/NetCore10/AppContextTests.cs Adds test to verify AppContext.TargetFrameworkName returns the expected framework name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Tyrrrz Tyrrrz merged commit 16c3c53 into master Nov 16, 2025
3 checks passed
@Tyrrrz Tyrrrz deleted the appcontext-targetframework branch November 16, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants