Skip to content

Various improvements for future TFM retargeting work - #4042

Merged
ViktorHofer merged 3 commits into
mainfrom
InfraImprovementsForFutureTFMRetargeting
Jan 5, 2026
Merged

ViktorHofer merged 3 commits into
mainfrom
InfraImprovementsForFutureTFMRetargeting

Conversation

@ViktorHofer

Copy link
Copy Markdown
Member

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.

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.
Copilot AI review requested due to automatic review settings January 5, 2026 08:52
@ViktorHofer
ViktorHofer requested review from a team as code owners January 5, 2026 08:52
@dotnet-policy-service
dotnet-policy-service Bot requested review from a team January 5, 2026 08:52

Copilot AI left a comment

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.

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.targets infrastructure 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
ViktorHofer merged commit 1f72659 into main Jan 5, 2026
11 checks passed
@ViktorHofer
ViktorHofer deleted the InfraImprovementsForFutureTFMRetargeting branch January 5, 2026 21:48
@dotnet-policy-service
dotnet-policy-service Bot requested review from a team January 5, 2026 21:49
MichaelSimons pushed a commit to MichaelSimons/dotnet that referenced this pull request Jan 9, 2026
MichaelSimons pushed a commit to MichaelSimons/dotnet that referenced this pull request Jan 9, 2026
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.

3 participants