Fix interactive TFM selection to evaluate property references in file-based app TargetFrameworks#53206
Draft
Copilot wants to merge 3 commits intorelease/10.0.3xxfrom
Draft
Fix interactive TFM selection to evaluate property references in file-based app TargetFrameworks#53206Copilot wants to merge 3 commits intorelease/10.0.3xxfrom
Copilot wants to merge 3 commits intorelease/10.0.3xxfrom
Conversation
Co-authored-by: jjonescz <[email protected]>
…eferences in file-based apps Co-authored-by: jjonescz <[email protected]>
Copilot
AI
changed the title
[WIP] Fix interactive TFM selection to evaluate TargetFrameworks
Fix interactive TFM selection to evaluate property references in file-based app TargetFrameworks
Mar 1, 2026
This was referenced Mar 1, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetTargetFrameworksFromSourceFilewas reading the rawTargetFrameworksdirective value without expanding MSBuild property references, causing$(MyProperty)to appear as a literal framework name in the TFM selection UI/error output.For example, this file-based app:
Previously surfaced
$(MyTfm)as a framework option instead ofnet9.0.Changes
RunCommand.cs: Collect all#:propertydirectives into a dictionary before evaluatingTargetFrameworks, then expand$(PropertyName)references using a newExpandMSBuildPropertieshelper. Last definition wins (matching MSBuild semantics). Circular references are resolved to empty string.RunCommand.cs: Added[GeneratedRegex]for$(...)pattern matching (AOT-compatible); madeRunCommandpartialto support it.RunFileTests.cs: Added regression test verifying that$(MyTfm)is evaluated to its property value in the TFM selection error output.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.