Repository navigation
Various improvements for future TFM retargeting work - #4042
Merged
Merged
Conversation
Most of these changes are learnings from the current net10.0->net11.0 TFM retargeting work. The new TargetingPacks.targets file in the Arcade SDK allows to retarget to a newer TFM more easily.
ViktorHofer
commented
Jan 5, 2026
ViktorHofer
commented
Jan 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces infrastructure improvements to simplify future Target Framework Moniker (TFM) retargeting work, particularly for moving from net10.0 to net11.0. The key improvement is a new TargetingPacks.targets file in the Arcade SDK that provides a reusable mechanism for retargeting to newer TFMs.
Key Changes:
- Simplifies source build logic by removing the dual-targeting scenario (NetPrevious + NetCurrent) that was needed for intermediate CI builds, now only targeting NetCurrent
- Replaces hardcoded TFM references with variables like
$(NetCurrent)and$(NetToolCurrent)in build infrastructure files - Introduces a new
TargetingPacks.targetsinfrastructure to help SDK recognize and work with TFMs not yet supported by the baseline SDK
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vstest/Directory.Build.targets | Simplifies source build conditions by removing NetPrevious/NetCurrent dual-targeting logic |
| src/roslyn/eng/targets/TargetFrameworks.props | Removes complex three-mode source build logic, consolidates to single NetCurrent targeting |
| src/razor/Directory.Build.props | Simplifies source build TFM configuration by removing dual-targeting branches |
| src/fsharp/Directory.Build.props | Removes DotNetBuildFromVMR condition check, simplifies to single source build mode |
| src/fsharp/Directory.Build.targets | Removes KnownFrameworkReference updates now handled by centralized TargetingPacks.targets |
| src/runtime/Directory.Build.targets | Removes KnownRuntimePack and KnownCrossgen2Pack updates now centralized |
| src/sdk/Directory.Build.props | Replaces hardcoded net10.0 and net472 with TFM variables for easier retargeting |
| src/sdk/src/Tasks/sdk-tasks/sdk-tasks.csproj | Converts from multi-targeting to single NetToolCurrent TFM, adds ExcludeAssets="runtime" to MSBuild packages |
| src/sdk/src/Tasks/sdk-tasks/sdk-tasks.InTree.targets | Updates UsingTask declarations with Runtime="NET" attribute for .NET-only execution |
| src/sdk/test/HelixTasks/HelixTasks.csproj | Converts from multi-targeting to single NetToolCurrent TFM, adds ExcludeAssets="runtime" |
| src/sdk/test/xunit-runner/XUnitRunner.targets | Updates task loading to use NetToolCurrent and Runtime="NET" TaskHostFactory |
| src/sdk/src/StaticWebAssetsSdk/benchmarks/*.csproj | Replaces hardcoded TFMs with NetCurrent and NetFrameworkToolCurrent variables |
| src/sdk/src/BuiltInTools/Watch/RuntimeDependencies.props | Uses $(NetCurrent) instead of hardcoded net10.0 |
| src/sdk/src/BuiltInTools/HotReloadAgent.Host/*.csproj | Uses $(NetCurrent) instead of hardcoded net10.0 |
| src/sdk/src/BuiltInTools/DotNetDeltaApplier/*.csproj | Uses $(NetCurrent) instead of hardcoded net10.0 |
| src/sdk/src/Microsoft.CodeAnalysis.NetAnalyzers/tools/*.csproj | Changes to NetToolCurrent and adds UseAppHost=false |
| src/sdk/src/Cli/Microsoft.DotNet.Cli.Utils/*.csproj | Updates comment to remove VS for Mac reference |
| src/nuget-client/build/common.project.props | Uses $(NetCurrent) instead of hardcoded net10.0 |
| src/nuget-client/Directory.Build.targets | Imports new TargetingPacks.targets for TFM support |
| src/nuget-client/eng/dotnet-build/TargetingPacks.targets | Copy of Arcade's TargetingPacks.targets for nuget-client repo |
| src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/TargetingPacks.targets | New centralized file for managing Known* pack items and versions for new TFMs |
| src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/Imports.targets | Imports new TargetingPacks.targets for SDK-style projects |
| src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/TargetFrameworkFilters.BeforeCommonTargets.targets | Adds $(NetCurrent) to source build TFM filter |
| src/roslyn/src/LanguageServer/*.csproj | Adds workaround to exclude assembly from ReadyToRun compilation |
| src/source-build-reference-packages/Directory.Build.props | Disables Arcade's ExcludeFrom* and TFM filtering infrastructure |
| repo-projects/nuget-client.proj | Passes NetCurrent, NetPrevious, and NetMinimum properties to nuget-client build |
| repo-projects/Directory.Build.targets | Adds experimental commented-out code for runtime pack version overrides |
| Directory.Build.props | Adds NoTargetFrameworkFiltering to disable Arcade's TFM filtering in VMR orchestrator |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ViktorHofer
commented
Jan 5, 2026
mmitche
reviewed
Jan 5, 2026
mmitche
reviewed
Jan 5, 2026
mmitche
reviewed
Jan 5, 2026
mmitche
reviewed
Jan 5, 2026
mmitche
approved these changes
Jan 5, 2026
MichaelSimons
pushed a commit
to MichaelSimons/dotnet
that referenced
this pull request
Jan 9, 2026
Co-authored-by: Copilot <[email protected]>
MichaelSimons
pushed a commit
to MichaelSimons/dotnet
that referenced
this pull request
Jan 9, 2026
Co-authored-by: Copilot <[email protected]>
This was referenced Sep 24, 2026
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.
Most of these changes are learnings from the current net10.0->net11.0 TFM retargeting work. The new TargetingPacks.targets file in the Arcade SDK allows to retarget to a newer TFM more easily.