Skip to content

Decouple .NET package versions from SDK previews - #36599

Merged
kubaflo merged 20 commits into
net11.0from
jonathanpeppers-decouple-net11-package-versions
Aug 13, 2026
Merged

Decouple .NET package versions from SDK previews#36599
kubaflo merged 20 commits into
net11.0from
jonathanpeppers-decouple-net11-package-versions

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Jul 15, 2026

Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause

MAUI uses package versions from the in-development .NET SDK for shipping projects, tests, and generated templates. During previews, each SDK update therefore changes shipping dependencies and template defaults even though the previous band's compatible packages are already published.

An unconstrained NuGet * is also not prerelease-aware: it selected stable .NET 10 ASP.NET Core packages for prerelease MAUI artifacts, causing the Blazor integration builds to fail with assembly version conflicts.

Description of Change

  • consumes the SDK-flowed .NET 11 dependency versions as N without changing eng/Versions.props — currently 11.0.0-rc.1.26379.102
  • defines one explicit MicrosoftDotNetN1PackageVersion in eng/NuGetVersions.targets, pinned to the published Preview 7 packages (11.0.0-preview.7.26381.103)
  • patches the existing package version properties to N-1 for shipping/source projects while current N is prerelease
  • uses current N for standard and MAUI test projects, plus explicit current-source runners, benchmarks, and manual test apps
  • automatically returns shipping projects to exact N when the current version becomes stable
  • covers Microsoft.Extensions., Microsoft.AspNetCore., Microsoft.JSInterop, System.Text.Json, System.Text.Encodings.Web, Microsoft.Bcl.AsyncInterfaces, and System.CodeDom
  • removes stale hardcoded test versions so centralized N selection applies consistently
  • emits prerelease-aware 11.0.0-* template defaults while N is prerelease and exact current versions when N is stable
  • records N-1 Microsoft.Extensions template dependencies in component governance during previews and exact current dependencies at GA

The N-1 substitution is gated on N containing a prerelease label, so it remained active across the Preview → RC transition and disables itself automatically at GA.

Validation

Verified against the current N / N-1 pair (11.0.0-rc.1.26379.102 / 11.0.0-preview.7.26381.103):

  • the pin is taken from the official release metadata (releases.jsonruntime.version for 11.0.0-preview.7), and all affected packages were confirmed published on nuget.org
  • confirmed the PR has no diff under eng/Version*, and adds no preview.6 literal
  • provisioned the RC 1 SDK with dotnet cake --target=dotnet and restored with it
  • Core, Controls.Core, and Microsoft.AspNetCore.Components.WebView.Maui resolve only N-1 packages — scanned each project.assets.json, zero RC 1 leakage into shipping projects
  • Core.UnitTests resolves the Microsoft.Extensions.* stack at current N (RC 1), confirming the test lane is unaffected
  • dotnet build of Core and Microsoft.AspNetCore.Components.WebView.Maui succeeds with 0 warnings and 0 errors — the BlazorWebView surface is where the original assembly version conflict appeared
  • template version items evaluate to 11.0.0-* for the .NET tokens while N is prerelease
  • eng/scripts/update-cgmanifest.ps1 resolves Microsoft.Extensions.* to N-1, and missing N-1 data still fails generation explicitly

Validated earlier against the previous band, with the mechanism unchanged since: consecutive preview-then-stable template packs switching all seven generated defaults from 11.0.0-* to exact 11.0.0; generating and building Blazor Server and Auto/WebAssembly projects from an installed template .nupkg; and inspecting 22 produced .nupkg nuspecs for dependency-band leakage.

Merge Notes

Merging the latest net11.0 conflicted with #35950, which added an AVALONIA_CONTROLS_MAUI_VERSION_VALUE template token to the property-group replacement block that this PR replaces with _TemplatePackageVersion items. The token was folded into the new item form, and its computed value is byte-identical to the previous behaviour (11.0.0-preview.6.*).

Avalonia.Controls.Maui is third-party, pinned separately in eng/Versions.props, and is intentionally not wired into the N/N-1 mechanism, so its band is preserved rather than floated to 11.0.0-*.

Alternatives Considered

PR #36598 attempted the same decoupling from main, using generic previous-published aggregates and private selector properties. This replacement targets the actual net11.0 dependency graph, treats the most recently published band as N-1, and uses an explicit N1-named property as requested.

A bare * was initially used for preview template defaults, but NuGet excludes prerelease packages from that range. Constraining the floating version to the current release (11.0.0-*) keeps preview templates floating while preventing fallback to stable packages from an older .NET release.

The initial implementation added duplicate conditional PackageReference items and a self-invoking MSBuild test harness to the template project. The final implementation instead patches the existing central version properties and keeps test-only targets out of the production project.

Issues Fixed

Fixes #36434

Copilot AI lite review requested due to automatic review settings July 15, 2026 20:08
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36599

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36599"

@azure-pipelines

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

Pull request overview

This PR updates MAUI’s versioning infrastructure so shipping/source projects can stay pinned to the latest published (N-1) .NET preview packages while the current .NET SDK is still prerelease, without forcing MAUI to rebuild and republish for every SDK preview drop. Tests, benchmarks, and manual/device runners are kept on the current SDK-flowed (N) versions, and templates are adjusted to emit floating * during prerelease and exact versions at GA.

Changes:

  • Introduces *N1* version properties in eng/Versions.props and adds UseN1PackageVersions-driven selection logic in eng/NuGetVersions.targets to switch shipping projects to N-1 during prerelease.
  • Removes hardcoded package versions from several test/runner projects so centralized version selection applies consistently, and explicitly opts those projects into current-N behavior via UseN1PackageVersions=false.
  • Updates template packing to (a) always refresh version substitutions and (b) validate expected N/N-1/stable behaviors at pack time; updates cgmanifest generation to record N-1 template dependencies during previews.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj Removes hardcoded Microsoft.Extensions.Logging.Console version and opts runner into current-N selection.
src/Templates/src/Microsoft.Maui.Templates.csproj Reworks template version substitution to emit * during prerelease, forces refresh on pack, and adds pack-time MSBuild assertions for version-selection scenarios.
src/Core/tests/DeviceTests.Shared/Core.DeviceTests.Shared.csproj Removes hardcoded Microsoft.Extensions.Logging.Console version so centralized selection applies.
src/Core/tests/Benchmarks/Core.Benchmarks.csproj Opts benchmarks into current-N selection with UseN1PackageVersions=false.
src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj Opts unit tests into current-N selection and removes hardcoded System.CodeDom version.
src/Controls/tests/ManualTests/Controls.ManualTests.csproj Opts manual tests into current-N selection and removes hardcoded Microsoft.Extensions.Logging.Debug version.
src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj Opts unit tests into current-N selection with UseN1PackageVersions=false.
src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj Removes hardcoded System.CodeDom version so centralized selection applies.
src/AI/tests/Essentials.AI.DeviceTests/Essentials.AI.DeviceTests.csproj Opts AI device tests into current-N selection with UseN1PackageVersions=false.
eng/Versions.props Adds N-1 (published) properties for targeted .NET packages and updates some current-N properties to align with the active preview.
eng/scripts/update-cgmanifest.ps1 Adds N-1-aware mapping so template cgmanifest tracks N-1 dependencies during prerelease.
eng/NuGetVersions.targets Implements UseN1PackageVersions-based switching between N-1 (shipping) and N (tests) while current versions are prerelease, and adds missing AspNetCore “previous edition” updates.

@github-actions github-actions Bot added the area-templates Project templates, Item Templates for Blazor and MAUI label Jul 15, 2026
Copilot AI review requested due to automatic review settings July 15, 2026 20:20

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread eng/scripts/update-cgmanifest.ps1 Outdated

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread eng/Versions.props Outdated
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Validated the output of maui-pr build 1511334 for commit 55ca94e581.

Package/nuspec validation

Downloaded the complete PackageArtifacts container: 22 .nupkg files, each containing exactly one .nuspec:

  • Microsoft.AspNetCore.Components.WebView.Maui.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.AspNetCore.Components.WebView.WindowsForms.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.AspNetCore.Components.WebView.Wpf.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.Build.Tasks.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.Core.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.Foldable.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.Maps.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.SourceGen.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Controls.Xaml.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Core.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Essentials.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Essentials.AI.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Graphics.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Graphics.Skia.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Graphics.Text.Markdig.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Maps.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Resizetizer.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Sdk.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.Maui.Templates.net11.11.0.0-ci.pr36599.7.26365.110.nupkg
  • Microsoft.NET.Sdk.Maui.Manifest-11.0.100-preview.6.11.0.0-ci.pr36599.7.26365.110.nupkg

Across the eight packages that carry affected dependency groups, I found 162 matching dependency entries:

  • 153 runtime/Extensions/AspNetCore/JSInterop entries use the expected published Preview 6 version: 11.0.0-preview.6.26359.118.
  • 9 entries are the intentionally independent Microsoft.Extensions.AI.Abstractions dependency at 10.3.0.
  • 0 nuspec entries leak Preview 7 version 11.0.0-preview.7.26364.110.

Representative entries:

  • Microsoft.AspNetCore.Components.WebView.Maui: Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Components.WebView, and Microsoft.JSInterop are 11.0.0-preview.6.26359.118 for net11.0.
  • Microsoft.Maui.Core: Microsoft.Extensions.Configuration and System.Text.Json are 11.0.0-preview.6.26359.118 for .NETStandard2.0 (and the equivalent target groups are also pinned).
  • Microsoft.Maui.Essentials.AI: Microsoft.Extensions.DependencyInjection.Abstractions is 11.0.0-preview.6.26359.118; Microsoft.Extensions.AI.Abstractions remains 10.3.0.

So the produced nuspec dependency pins match the intended shipping N-1 model.

CI result

CI is not green. Build, pack, Helix unit tests, AOT, samples, and the other integration legs passed, but both Blazor integration legs failed:

  • Run Integration Tests Blazor macOS
  • Run Integration Tests Blazor windows

The packed template has all seven affected defaults set to literal *, including componentsWebVersion. During integration testing this resolves Microsoft.AspNetCore.Components/.Web 10.0.10, while Microsoft.AspNetCore.Components.WebView.Maui was built against assembly version 11.0.0.0. Compilation then fails with CS1705/MSB3277, for example:

Microsoft.AspNetCore.Components.WebView.Maui, Version=11.0.0.0 uses Microsoft.AspNetCore.Components.Web, Version=11.0.0.0, which has a higher version than the referenced Microsoft.AspNetCore.Components.Web, Version=10.0.0.0.

The nuspecs are correct, but the unbounded preview template wildcard is currently not viable; it can select the prior stable major and makes the PR not ready until constrained or otherwise corrected.

Copilot AI review requested due to automatic review settings July 16, 2026 16:46

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread eng/scripts/update-cgmanifest.ps1 Outdated
Copilot AI review requested due to automatic review settings July 16, 2026 16:59

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

/azp run maui-pr

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Mark projects importing the shared device-test runner props as MAUI test projects so they consume current N packages, and clarify the cgmanifest script synopsis.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f8808afd-de8d-414a-b271-fae23ee7b596
Copilot AI review requested due to automatic review settings July 22, 2026 21:27

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj:30

  • System.CodeDom is now relying on central versioning, but this project does not set IsTestProject/MauiTestProject, so eng/NuGetVersions.targets will default UseN1PackageVersions to true and (during SDK previews) pin SystemCodeDomPackageVersion to the published N-1 version. That means this unit test project will unintentionally compile against N-1 packages rather than current N. Consider either marking this as a test project (<MauiTestProject>true</MauiTestProject>) or explicitly binding this reference to current N.
    <PackageReference Include="System.CodeDom" />

@jonathanpeppers

Copy link
Copy Markdown
Member Author

Final CI artifact validation (build 1522346)

Validated the artifacts produced for PR head 6f792d0ad5077717c309b43c60a1dabe5b40632b.

Binlog: tests use N, shipping projects use N-1

Using binlogtool against Windows_NT_Build Windows (Debug)_Attempt1/build_Windows.binlog:

  • Controls.Xaml.UnitTests.csproj: UseN1PackageVersions=false; MicrosoftExtensionsConfigurationVersion and SystemCodeDomPackageVersion are N = 11.0.0-preview.7.26365.101.
  • Graphics.DeviceTests.csproj: UseN1PackageVersions=false; MicrosoftExtensionsConfigurationVersion is N = 11.0.0-preview.7.26365.101.
  • Essentials.DeviceTests.csproj: UseN1PackageVersions=false; MicrosoftExtensionsConfigurationVersion is N = 11.0.0-preview.7.26365.101.
  • Controls.Build.Tasks.csproj: UseN1PackageVersions=true; MicrosoftExtensionsConfigurationVersion and SystemCodeDomPackageVersion are N-1 = 11.0.0-preview.6.26359.118.

Shipping NuGet packages

Downloaded and unpacked all 22 produced packages:

  • Microsoft.AspNetCore.Components.WebView.Maui.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.AspNetCore.Components.WebView.WindowsForms.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.AspNetCore.Components.WebView.Wpf.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.Build.Tasks.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.Core.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.Foldable.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.Maps.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.SourceGen.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Controls.Xaml.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Core.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Essentials.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Essentials.AI.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Graphics.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Graphics.Skia.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Graphics.Text.Markdig.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Maps.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Resizetizer.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Sdk.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.Maui.Templates.net11.11.0.0-ci.pr36599.7.26372.87.nupkg
  • Microsoft.NET.Sdk.Maui.Manifest-11.0.100-preview.7.11.0.0-ci.pr36599.7.26372.87.nupkg

Across their .nuspec files, all 153 dependency entries covered by this change use N-1 = 11.0.0-preview.6.26359.118. The covered dependencies found were:

  • Microsoft.AspNetCore.Authorization (6 entries)
  • Microsoft.AspNetCore.Components.WebView (8)
  • Microsoft.Extensions.Configuration (30)
  • Microsoft.Extensions.DependencyInjection (22)
  • Microsoft.Extensions.DependencyInjection.Abstractions (9)
  • Microsoft.Extensions.Hosting.Abstractions (17)
  • Microsoft.Extensions.Logging (22)
  • Microsoft.Extensions.Logging.Abstractions (31)
  • Microsoft.JSInterop (6)
  • System.Text.Json (2)

No 11.0.0-preview.7.26365.101 dependency version appears in any produced .nuspec.

Template package contents

Unpacked Microsoft.Maui.Templates.net11.11.0.0-ci.pr36599.7.26372.87.nupkg and inspected all 13 template manifests. It contains 7 floating N defaults, all exactly 11.0.0-*:

  • maui-mobile/.template.config/template.json (1)
  • maui-multiproject/.template.config/template.json (1)
  • maui-blazor/.template.config/template.json (1)
  • maui-blazor-solution/.template.config/template.json (4)

There are no exact Preview 6/Preview 7 versions in template content and no unreplaced version placeholders.

The package/pack and all template integration lanes passed. Overall CI is red for unrelated file-lock failures: Windows Debug could not access .buildtasks/Microsoft.Maui.Core.props, and one Essentials.AI Helix test could not open its test-data file because another process held it.

@kubaflo kubaflo 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.

Could you please resolve conflicts?

…rsions

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7d43af42-9e93-4be0-9754-b362beec3456
Copilot AI review requested due to automatic review settings July 27, 2026 18:45

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@kubaflo kubaflo 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.

Could you please resolve conflicts?

…rsions

Fold the new Avalonia template token into the item-based version replacement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7d43af42-9e93-4be0-9754-b362beec3456
Preview 7 shipped 2026-08-11 as 11.0.0-preview.7.26381.103, and N is now 11.0.0-rc.1.26379.102.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7d43af42-9e93-4be0-9754-b362beec3456
Copilot AI review requested due to automatic review settings August 12, 2026 14:56

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

eng/scripts/update-cgmanifest.ps1:22

  • The log message implies this script only reads versions from Versions.props, but it also reads the N-1 pin from eng/NuGetVersions.targets. Updating the message will make troubleshooting cgmanifest generation failures (e.g., missing MicrosoftDotNetN1PackageVersion) more straightforward.
# Read the central package version files
Write-Host "Reading versions from: $versionsPropsPath"
[xml]$versionsProps = Get-Content $versionsPropsPath -Raw

@jonathanpeppers

Copy link
Copy Markdown
Member Author

Verification against CI-produced packages

Verified the decoupling end-to-end against the artifacts from CI build 1550274 (SHA 7e49d93b), rather than by inspecting the build logic alone.

Packages

Downloaded PackageArtifacts (21 nupkgs) and inspected every .nuspec:

  • 126 of 126 dependency entries in the affected families resolve to 11.0.0-preview.7.26381.103 (N-1) — covering Microsoft.Extensions.*, Microsoft.AspNetCore.*, Microsoft.JSInterop, System.Text.Json, System.Text.Encodings.Web, Microsoft.Bcl.AsyncInterfaces, and System.CodeDom.
  • Zero leakage: no rc.1 (current N) and no preview.6 (the previous pin) appears in any shipping dependency.

The most direct evidence is the manifest package name: Microsoft.NET.Sdk.Maui.Manifest-11.0.100-rc.1. The build genuinely ran against the rc.1 SDK while every shipping dependency stayed on preview.7 — which is exactly the decoupling this PR is for.

Templates

In the packed Microsoft.Maui.Templates.net11:

  • All 7 .NET template version defaults are 11.0.0-* (prerelease-aware floating, correct while N is prerelease).
  • 0 unresolved *_VERSION_VALUE tokens, confirming the _TemplatePackageVersion item-based rewrite substitutes everything the previous property-group form did.
  • The one remaining 11.0.0-preview.6.* is the Avalonia.Controls.Maui token in maui-mobile. That is a third-party package pinned separately in eng/Versions.props and deliberately not wired into N/N-1; it is given a band-preserving wildcard because its build numbers are unrelated to .NET's, so a plain 11.0.0-* would float it onto unrelated Avalonia prereleases. The resolved value is byte-identical to the behavior before this PR.

CI

All 30 checks pass. Worth highlighting that the Blazor integration tests pass on both Windows and macOS — that is the precise scenario in the root cause, where floating * versions resolved to stable .NET 10 packages and produced assembly version conflicts.

Scope caveat

This validates the prerelease path. The GA path (N stable, so the Contains('-') gate disengages and templates drop to exact versions) cannot be exercised until an SDK without a prerelease label flows in. It was verified earlier by packing with StabilizePackageVersion, and that logic is unchanged by the rebase.

@kubaflo kubaflo 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.

@jonathanpeppers — fresh adversarial review of 7e49d93beceb5eb6b4b82162dea1a50803677973 completed.

NEEDS_CHANGES — one high-confidence release-pack regression survived independent review by Claude Opus 5, Gemini 3.1 Pro, GPT-5.6 Sol, MAUI expert review, and final Terra arbitration. Required maui-pr build 1550274 and CLA pass, but CI exercises the preview lane rather than StabilizePackageVersion=true.

The title accurately describes the main N/N-1 change. The description’s claims that Avalonia behavior is byte-identical and that the stabilized path remained unchanged are inaccurate for the current head.

Comment thread src/Templates/src/Microsoft.Maui.Templates.csproj Outdated
The rewrite to _TemplatePackageVersion items replaced the upstream
StabilizePackageVersion guard with a Contains('-') check. Those are not
equivalent: a stabilized pack built while a version is still prerelease
would emit a wildcard default instead of the exact pin.

This affected Avalonia.Controls.Maui in every stabilized build, since it
ships on an independent cadence and stays prerelease when MAUI GA/SR
builds are stabilized. A shipped --with-avalonia template could then
restore a later third-party build than the one validated with that MAUI
release. The .NET tokens had the same latent defect for a stabilized SR
built against a prerelease SDK band.

Restore the stabilization guard on all five wildcard conditions and add
an Error that fails the pack if any stabilized token resolves to a
wildcard, so the invariant is enforced rather than assumed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d43af42-9e93-4be0-9754-b362beec3456
@kubaflo
kubaflo merged commit cc86ec1 into net11.0 Aug 13, 2026
5 of 14 checks passed
@kubaflo
kubaflo deleted the jonathanpeppers-decouple-net11-package-versions branch August 13, 2026 19:44
@github-actions github-actions Bot added this to the .NET 11.0-preview7 milestone Aug 13, 2026

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

eng/NuGetVersions.targets:7

  • MicrosoftDotNetN1PackageVersion is set unconditionally, which makes it difficult to override for local validation (e.g., testing a different N-1 band) since this assignment will overwrite any value passed via command-line or an earlier import. Consider only assigning the pinned default when the property is empty, mirroring the existing UseN1PackageVersions pattern above.
    <MicrosoftDotNetN1PackageVersion>11.0.0-preview.7.26381.103</MicrosoftDotNetN1PackageVersion>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-templates Project templates, Item Templates for Blazor and MAUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants