Skip to content

Retarget the SDK to net12.0 - #56086

Closed
marcpopMSFT wants to merge 15 commits into
mainfrom
marcpopmsft-net12-migration
Closed

marcpopMSFT wants to merge 15 commits into
mainfrom
marcpopmsft-net12-migration

Conversation

@marcpopMSFT

@marcpopMSFT marcpopMSFT commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

🤖 The SDK can now target net12.0 after the required known framework reference support became available. This adopts the first branded .NET 12 bootstrap toolset and retargets SDK components while leaving the built SDK product default, templates, runtime packs, and unavailable ASP.NET/workload artifacts on net11 for their separate rollover steps.

Changes

  • Update both global.json SDK entries to 12.0.100-alpha.1.26458.102; future bootstrap updates for this effort must remain on .NET 12 and at or above this build.
  • Retarget SDK projects, task/tool lookup paths, supported-framework metadata, and the containers PublicAPI baseline to net12.
  • Retain the temporary NETCoreAppMaximumVersion=12 override until Arcade advances its default.
  • Remove pre-branding workarounds now supplied by the branded SDK, including AllowMissingPrunePackageData and temporary Options, Asn1, and URI package references.
  • Keep generated test projects, template expectations, and selected ASP.NET test assets aligned with the built SDK's current net11 product default. ToolsetInfo.CurrentTargetFramework remains synchronized with Product.TargetFrameworkVersion, while ToolsetInfo.SdkTargetFramework identifies the net12 source/test-host assembly TFM.
  • Align publish, Static Web Assets, Aspire watch, template integration, file-based app, project conversion, and dotnet test coverage with the intended split between net12 source compilation and deferred net11 product assets.
  • Install the bootstrap SDK's exact Microsoft.NETCore.App and Microsoft.AspNetCore.App runtimes into cross-architecture test sidecars so Helix payloads do not mix target-architecture hosts with x64 shared-framework binaries.
  • Honor RootCommand.HelpName in the SDK help builder so managed and NativeAOT usage consistently displays dotnet regardless of the test host executable name.
  • Build the managed NativeAOT integration test module explicitly into deterministic RID-specific output instead of relying on incidental publish artifacts.
  • Refresh telemetry context immediately before MSBuild execution and ensure persistent MSBuild servers replace stale trace and environment state between requests.
  • Document the new-major feed step in the target-framework rollover guide.

Temporary cross-architecture runtime bridge

The bootstrap SDK selected by global.json includes a net12 runtime for the build host architecture, while the repository's normal product dependency flow still supplies exact net11 Core and ASP.NET Core runtimes for target-architecture test payloads. Because this PR moves the SDK test-host assemblies to net12, cross-architecture Helix legs also need target-architecture copies of the bootstrap SDK's exact net12 Microsoft.NETCore.App and Microsoft.AspNetCore.App runtimes. The restore helpers therefore acquire those bootstrap runtime versions explicitly and stage them in a separate target-architecture sidecar rather than mixing them into the host .dotnet installation.

Once Version.Details.props advances the normal product runtime flow to net12, the bootstrap-specific Core and ASP.NET Core runtime additions should be removed because the regular toolset acquisition will provide those versions. The cross-architecture sidecar mechanism is a separate concern and may still be required whenever the build host and Helix payload architectures differ.

Validation

  • Full Release SDK build.
  • Focused publish and prune-package tests: 25 passed.
  • Focused Static Web Assets tests: 44 passed.
  • Focused Aspire watch test: passed.
  • CLI regression tests: 15 passed.
  • Broad TFM regression selection: 483 passed; the only 5 local failures require Windows symbolic-link privileges unavailable in this environment.
  • End-to-end project/template default-framework tests: 96 passed.
  • Template integration tests: 26 passed; the remaining 21 local failures reached test execution but exceeded Windows path limits in this deep worktree.
  • NativeAOT PowerShell and shell harness syntax validated, and the exact managed-module build produced dotnet-aot.Tests.dll in deterministic output.
  • Final build-1588187 regressions: container package layout, all four preview-feature cases, dotnet-watch file-set serialization, the affected template matrix, and managed CLI root-help tests passed.
  • Build-1589511 follow-up: both restore helpers resolve 12.0.0-alpha.1.26458.102, the macOS arm64 payload exists on the configured fallback feed, and all 41 affected CLI help/response-file cases pass.
  • Build-1589846 follow-up: all 14 Aspire service tests pass locally, both net12 macOS arm64 runtime archives resolve from the fallback feed, and cross-build restore now acquires the matching ASP.NET Core runtime required by Aspire and BrowserRefresh test hosts.

Update the bootstrap SDK and package feeds, retarget SDK components and current task paths to net12.0, and preserve temporary net11 dependencies until product branding catches up.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Copilot AI lite review requested due to automatic review settings September 1, 2026 20:07
@marcpopMSFT
marcpopMSFT requested review from a team, lbussell and mthalman as code owners September 1, 2026 20:07
@marcpopMSFT
marcpopMSFT requested a review from a team September 1, 2026 20:07
@marcpopMSFT
marcpopMSFT requested review from a team and vijayrkn as code owners September 1, 2026 20:07
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🔵 Needs a closer look

Pull request overview

Retargets dotnet/sdk’s build-time components and SDK task/tool lookup paths to net12.0, along with bootstrap and metadata updates needed to build and run the SDK against the new TFM while keeping publish product-test TFMs on net11.0 for now.

Changes:

  • Update bootstrap acquisition inputs (global.json + NuGet feeds) to a toolset that can build net12-targeting SDK components.
  • Retarget MSBuild task/tool lookup paths across SDK targets (Publish, Build.Tasks, Razor/SWA/BlazorWasm, Containers) from net11.0 to net12.0.
  • Extend supported-framework metadata and roll PublicAPI baselines/docs forward to net12.0.
File summaries
File Description
test/Microsoft.NET.Sdk.Web.Tests/PublishTests.cs Update compile-time gating for SupportedTfms for the new SDK build TFM while keeping scenarios on net11.
test/Microsoft.NET.Publish.Tests/PublishTestUtils.cs Same SupportedTfms gating adjustment for publish tests.
src/WebSdk/Publish/Targets/Microsoft.NET.Sdk.Publish.targets Retarget publish task folder selection to net12.0 for Core MSBuild.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetFrameworks.props Add net12 supported framework metadata.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets Retarget build tasks directory TFM selection to net12.0 for Core MSBuild.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ApiCompat.targets Retarget ApiCompat task assembly lookup path to net12.0.
src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets Retarget Build.Extensions tasks lookup path to net12.0 for Core MSBuild.
src/StaticWebAssetsSdk/Targets/Sdk.StaticWebAssets.CurrentVersion.targets Retarget SWA tasks/tool lookup paths to net12.0.
src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets Retarget Razor tasks lookup path to net12.0.
src/Layout/redist/tools/tool_fsc.csproj Temporary rollover workaround: pin F# compiler package TFM path to net11.0.
src/Containers/packaging/build/Microsoft.NET.Build.Containers.props Retarget container tasks folder selection to net12.0.
src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net12.0/PublicAPI.Unshipped.txt New net12 PublicAPI baseline content (issue: missing #nullable enable header).
src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net12.0/PublicAPI.Shipped.txt New net12 shipped baseline stub.
src/Cli/dotnet-aot/dotnet-aot.csproj Update example comment to reflect net12 RID-specific assets target.
src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets Retarget BlazorWasm tasks/tool lookup paths to net12.0.
src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets Retarget BlazorWasm tasks/tool lookup paths to net12.0.
NuGet.config Add dotnet12 feeds for bootstrap-associated packages.
global.json Bump bootstrap SDK version to 11.0.100-rc.1.26431.117.
documentation/general/UpdateToNewTargetFramework.md Document adding new-major feeds as part of rollover.
Directory.Build.props Temporary rollover workaround: set NetCurrent/SdkTargetFramework explicitly to net12.0.
.github/memory/API_MAP.md Update memory doc link to container PublicAPI baseline for net12.0.
Review details
  • Files reviewed: 19/21 changed files
  • Comments generated: 0
  • Review effort level: Lite

Apply the maximum target framework and missing prune data overrides in repository build configuration so every CI leg can build the net12-targeted SDK.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner September 1, 2026 21:42
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Build Failure Analysis

Result: No build/compile errors found in the binlogs I could analyze — this looks like a non-build failure (test/Helix/publishing) or the root cause lives in a leg I could not inspect (see gap below), so no code changes are suggested.

What I checked

I queried binlog-mcp (binlog_overview, and binlog_errors/binlog_diagnose/binlog_analyzer_summary where a gap needed filling) against all 20 published build legs from the failed Azure DevOps run. 18 of 20 legs returned successfully with Build: SUCCEEDED, Errors: 0:

Leg Result
10_0 Windows x64 SUCCEEDED, 0 errors
10_1 Windows x64 SUCCEEDED, 0 errors
10_2 Windows x64 SUCCEEDED, 0 errors
1_0 Linux arm64 AOT SUCCEEDED, 0 errors
2_0 Linux arm64 SUCCEEDED, 0 errors
3_0 Linux x64 AOT SUCCEEDED, 0 errors
3_1 Linux x64 AOT SUCCEEDED, 0 errors
4_0 Linux x64 SUCCEEDED, 0 errors
4_1 Linux x64 SUCCEEDED, 0 errors
4_2 Linux x64 SUCCEEDED, 0 errors
5_0 Mac arm64 AOT SUCCEEDED, 0 errors
5_1 Mac arm64 AOT SUCCEEDED, 0 errors
6_0 Mac arm64 SUCCEEDED, 0 errors
6_1 Mac arm64 SUCCEEDED, 0 errors
6_2 Mac arm64 SUCCEEDED, 0 errors
7_0 Windows arm64 AOT SUCCEEDED, 0 errors
8_0 Windows x64 AOT SUCCEEDED, 0 errors
9_1 Windows x64 FullFramework SUCCEEDED, 0 errors

Analysis gap

Two legs could not be analyzed — every binlog-mcp tool call against them (binlog_overview, binlog_errors, binlog_diagnose, binlog_analyzer_summary), retried multiple times, failed with context deadline exceeded (server-side timeout reading the binlog):

  • 8_1_Windows_x64_AOT_Logs_Attempt1.binlog
  • 9_0_Windows_x64_FullFramework_Logs_Attempt1.binlog

Since these two logs could not be inspected, I cannot rule out a compile failure hiding in one of them. If the pipeline failure isn't explained by a test/Helix/publishing issue, please have a human check these two legs directly in the Azure DevOps build:

🔗 [Azure DevOps build results]((dev.azure.com/redacted)

Verified PR head SHA (ea918827f47015441a2c5fb47c736fcf6af48100) is unchanged and matches the analyzed build.

🤖 Generated by the Build Failure Analysis workflow using binlog-mcp · commit ea91882

🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 62.2 AIC · ⌖ 2.56 AIC · ⊞ 7.1K · [◷]( · ◷)

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26

# Conflicts:
#	global.json
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Keep generated-project and template tests aligned with the net11 product default during the staged net12 source rollover. Preserve dotnet help naming and make NativeAOT managed-module validation deterministic.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
marcpopMSFT added a commit to dotnet/dotnet that referenced this pull request Sep 9, 2026
Port the latest fixes from dotnet/sdk#56086 and update the VMR root bootstrap SDK so component builds have net12 ASP.NET Core framework-reference metadata.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: a76caf7b-a621-4acd-9c5c-42b84d70181c
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner September 9, 2026 17:33
marcpopMSFT and others added 3 commits September 9, 2026 14:06
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 464c5bbd-b195-44ce-a3c9-cd19f20fcf26
@marcpopMSFT

Copy link
Copy Markdown
Member Author

closed in favor of dotnet/dotnet#9076

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.

2 participants