Skip to content

Retarget SDK sources to net12.0 without updating stage zero - #9503

Merged
marcpopMSFT merged 4 commits into
mainfrom
marcpopMSFT-minsdknet12update
Sep 21, 2026
Merged

marcpopMSFT merged 4 commits into
mainfrom
marcpopMSFT-minsdknet12update

Conversation

@marcpopMSFT

@marcpopMSFT marcpopMSFT commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

🤖 Separates SDK source retargeting from the stage-0 SDK update by porting dotnet/sdk#56348 into the VMR, including all follow-up fixes through 006c74304ad2e988d3e0d96bb87e6b2b0b7392c3. Both the root and src/sdk/global.json SDK version entries remain unchanged.

Approach

  • Target SDK sources at net12.0 using Arcade's explicit net11.0 targeting-pack baseline. Reference APIs and runtime requirements remain on .NET 11 for this phase.
  • Update task/tool lookup paths and container API baselines to match the new source TFM, while retaining F# and WindowsDesktop paths at their producers' packaged TFM.
  • Keep generated test-app defaults separate from the compiled SDK TFM. Include upstream task-layout regression coverage and rollover documentation.

The port preserves the VMR's newer source-only runtime-pack conditions in Directory.Build.targets. Temporary bootstrap accommodations copy missing ASP.NET Core framework metadata, load pruning data from the nearest supported framework, and recognize live baseline reference-pack versions. The new pruning and baseline-version accommodations apply only to net12 source targets (including platform-qualified variants) on the older bootstrap. Product branding, runtime dependencies, and template defaults are unchanged.

CI follow-up fixes

  • Align live reference packs to avoid copying framework-provided dependency-injection assemblies into the SDK layout; add regression coverage and resolve watch tools using the SDK source TFM.
  • Isolate VSTest verbosity assertions from build output, replace process-module inspection with per-test active-run markers in both consumers, and use bounded localization cleanup retries with the SDK under test.
  • Link both shipped and unshipped container API baselines.
  • Preserve the VMR fixes for source-built VSTest's net11 CLI layout and WorkloadManifestReader's additional source-only net11 assets, needed by Arcade in the offline rebuild.

Validation

  • Restored and built Microsoft.NET.Build.Tasks for net12.0: no warnings or errors.
  • Executed framework/pruning targets: 308 pruning entries loaded without allowing missing data, and compiler references resolve to the live 11.0.0-rc.1.26453.118 pack.
  • Verified platform-qualified Core/ASP.NET pack alignment, downlevel and simulated newer-bootstrap exclusions, product-build tool-shim exclusion, and preservation of source-only overrides even when pack versions differ from both source and baseline TFMs.
  • Verified upstream patch parity outside the adapted build targets, documentation links, unchanged bootstrap pins, and preserved VMR compatibility fixes.

Local validation used installed SDK 11.0.100-rc.1.26425.128, selected by the existing roll-forward policy, rather than the exact pinned 11.0.100-rc.1.26420.103. The latest port's full VMR/source-build and SDK layout/integration coverage requires CI; no built SDK redist is available in this checkout.

Port dotnet/sdk#56348 into the VMR, preserving its runtime-pack conditions and leaving both global.json bootstrap SDK pins unchanged.

Co-authored-by: Copilot App <[email protected]>
Copilot AI lite review requested due to automatic review settings September 18, 2026 16:52
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 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.

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Retargets SDK source and task/tool assemblies to net12.0 while retaining .NET 11 bootstrap metadata, runtime dependencies, and generated test-app defaults.

Changes:

  • Updates SDK TFM and task/tool lookup paths.
  • Adds bootstrap compatibility accommodations and task-layout regression tests.
  • Updates container API baselines and rollover documentation.
File summaries
File Description
src/sdk/test/Microsoft.NET.TestFramework/ToolsetInfo.cs Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Sdk.Web.Tests/PublishTests.cs Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Sdk.Razor.Tests/Microsoft.NET.Sdk.Razor.Tests.csproj Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests.csproj Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Publish.Tests/PublishTestUtils.cs Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Build.Tests/GivenTheSdkTaskLayout.cs Updated as part of this pull request.
src/sdk/test/Microsoft.NET.Build.Containers.IntegrationTests/PackageTests.cs Updated as part of this pull request.
src/sdk/src/WebSdk/Publish/Targets/Microsoft.NET.Sdk.Publish.targets Updated as part of this pull request.
src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets Updated as part of this pull request.
src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ApiCompat.targets Updated as part of this pull request.
src/sdk/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets Updated as part of this pull request.
src/sdk/src/StaticWebAssetsSdk/Targets/Sdk.StaticWebAssets.CurrentVersion.targets Updated as part of this pull request.
src/sdk/src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets Updated as part of this pull request.
src/sdk/src/Layout/redist/tools/tool_fsc.csproj Updated as part of this pull request.
src/sdk/src/Layout/redist/targets/Crossgen.targets Updated as part of this pull request.
src/sdk/src/Containers/packaging/build/Microsoft.NET.Build.Containers.props Updated as part of this pull request.
src/sdk/src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net12.0/PublicAPI.Unshipped.txt Updated as part of this pull request.
src/sdk/src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net12.0/PublicAPI.Shipped.txt Updated as part of this pull request.
src/sdk/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets Updated as part of this pull request.
src/sdk/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets Updated as part of this pull request.
src/sdk/documentation/general/UpdateToNewTargetFramework.md Updated as part of this pull request.
src/sdk/Directory.Build.targets Updated as part of this pull request.
src/sdk/Directory.Build.props Updated as part of this pull request.
src/sdk/.github/memory/API_MAP.md Updated as part of this pull request.
Review details

Suppressed comments (1)

src/sdk/Directory.Build.props:73

  • SdkTargetFramework is also used to lay out dotnet-watch: its producer copies the files under tools/$(SdkTargetFramework), but test/dotnet-watch.Tests/TestUtilities/MSBuildFixture.cs:27 still constructs the fallback path from ToolsetInfo.CurrentTargetFramework (net11.0). After this change the dependencies are under net12.0, so the watch tests' assembly resolver misses them; update that lookup to use SdkTargetFramework.
    <NetCurrent>net12.0</NetCurrent>
    <SdkTargetFramework>$(NetCurrent)</SdkTargetFramework>
    <TargetingPackBaselineTargetFramework>net11.0</TargetingPackBaselineTargetFramework>
    <TargetingPackCurrentTargetFramework>$(SdkTargetFramework)</TargetingPackCurrentTargetFramework>
  • Files reviewed: 24/26 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

marcpopMSFT and others added 2 commits September 18, 2026 12:15
Decouple the external VSTest CLI package path from the SDK-local NetCurrent override. Preserve the net10.0 lookup for regular builds.

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

Include a source-only net11.0 target so Arcade workload tasks can consume the package during stage-2 builds while SDK sources target net12.0. Document the cross-repository bootstrap compatibility requirement.

Co-authored-by: Copilot App <[email protected]>
Port dotnet/sdk#56348 follow-ups through 006c74304ad: align live baseline packs and pruning data, fix watch lookup, stabilize CLI and localization tests, and clarify container API documentation. Preserve VMR source-only pack overrides and bootstrap compatibility fixes.

Co-authored-by: Copilot App <[email protected]>
@marcpopMSFT
marcpopMSFT enabled auto-merge (squash) September 21, 2026 21:33
@marcpopMSFT
marcpopMSFT merged commit 1931b44 into main Sep 21, 2026
11 checks passed
@marcpopMSFT
marcpopMSFT deleted the marcpopMSFT-minsdknet12update branch September 21, 2026 23:46
Comment on lines +49 to +55
<!-- NetTFMUpdate: Arcade creates Core pack entries, but watch and its tests also need ASP.NET Core. -->
<ItemGroup Condition="'$(EnableKnownPackItemsForUnknownTargetFramework)' == 'true'">
<KnownFrameworkReference
Include="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
</ItemGroup>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bring this into the Arcade infra:

<!-- Add Known* items if the SDK doesn't support the TargetFramework yet. Uses the metadata from the `TargetingPackBaselineTargetFramework`, which includes versions. -->
<ItemGroup Condition="'$(EnableKnownPackItemsForUnknownTargetFramework)' == 'true'">
<KnownFrameworkReference
Include="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownFrameworkReference->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
<KnownRuntimePack
Include="@(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)')->WithMetadataValue('RuntimePackLabels', 'Mono'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('RuntimePackLabels', 'Mono')->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
<KnownRuntimePack
Include="@(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)')->WithMetadataValue('RuntimePackLabels', 'NativeAOT'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('RuntimePackLabels', 'NativeAOT')->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
<KnownILCompilerPack
Include="@(KnownILCompilerPack->WithMetadataValue('Identity', 'Microsoft.DotNet.ILCompiler')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownILCompilerPack->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
<KnownCrossgen2Pack
Include="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownCrossgen2Pack->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
<KnownAppHostPack
Include="@(KnownAppHostPack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
<KnownILLinkPack
Include="@(KnownILLinkPack->WithMetadataValue('Identity', 'Microsoft.NET.ILLink.Tasks')->WithMetadataValue('TargetFramework', '$(TargetingPackBaselineTargetFramework)'))"
TargetFramework="$(TargetingPackCurrentTargetFramework)"
Condition="'@(KnownILLinkPack->AnyHaveMetadataValue('TargetFramework', '$(TargetingPackCurrentTargetFramework)'))' != 'true'" />
</ItemGroup>

And remove the block here then.

<PropertyGroup Condition="('$(TargetFramework)' == '$(SdkTargetFramework)' or $(TargetFramework.StartsWith('$(SdkTargetFramework)-'))) and
$([MSBuild]::VersionLessThan('$(BundledNETCoreAppTargetFrameworkVersion)', '12.0'))">
<!-- NetTFMUpdate: Use the baseline framework's pruning data and live packs until stage 0 supports net12. -->
<LoadPrunePackageDataFromNearestFramework>true</LoadPrunePackageDataFromNearestFramework>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should set this centrally in the Arcade SDK in TargetingPacks.BeforeCommon.targets. I don't think there are any downsides to that.

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.

4 participants