Skip to content

Implement automatic TargetFramework setting feature#52397

Open
ViktorHofer wants to merge 3 commits intomainfrom
ViktorHofer-patch-2
Open

Implement automatic TargetFramework setting feature#52397
ViktorHofer wants to merge 3 commits intomainfrom
ViktorHofer-patch-2

Conversation

@ViktorHofer
Copy link
Member

Fixes #29949

Automatically set the TargetFramework property if not set, to the SDK bundled target framework. Provide an opt-out property if needed.

I double checked that nothing reads from TargetFramework before that file is imported.

Fixes #29949

Automatically set the TargetFramework property if not set to the sdk bundled target framework. Provide an opt-out property if needed.
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 implements an automatic TargetFramework setting feature that addresses issue #29949, which requested enabling projects to use the SDK's bundled target framework when none is explicitly specified. The change allows developers to skip specifying a TargetFramework property in their project files, with the SDK automatically defaulting to the bundled TFM.

Changes:

  • Adds automatic TargetFramework property setting in Microsoft.NET.TargetFrameworkInference.targets when both TargetFramework and TargetFrameworks properties are not set
  • Introduces an opt-out mechanism via the AutomaticallySetTargetFrameworkIfUnset property
  • Sets TargetFramework to BundledNETCoreAppTargetFramework (the SDK's bundled target framework moniker)

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.

Enable projects to use the SDK TargetFramework

2 participants