Skip to content

fix(sdk): Use the WinRT.Runtime 2.3 projection on Windows targets (backport #25836) - #26084

Closed
mergify[bot] wants to merge 1 commit into
release/stable/7.0from
mergify/bp/release/stable/7.0/pr-25836
Closed

mergify[bot] wants to merge 1 commit into
release/stable/7.0from
mergify/bp/release/stable/7.0/pr-25836

Conversation

@mergify

@mergify mergify Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #24905

PR Type:

🐞 Bugfix

What changed? 🚀

A fresh app's Windows head fails to build with the .NET 10 SDK:

error CS1705: Assembly 'Uno.UI.HotDesign.Client' ... uses 'WinRT.Runtime, Version=2.3.1.0' which has a higher version than referenced assembly 'WinRT.Runtime' with identity 'WinRT.Runtime, Version=2.2.0.0'

Cause

  • WinRT.Runtime comes from the Windows SDK projection targeting pack, Microsoft.Windows.SDK.NET.Ref. The .NET SDK adds it implicitly for -windows10.0.x target frameworks and picks one exact version from its own bundled data; a package can't ask for a newer one (a nuspec framework reference has no version).
  • Uno's Windows assemblies, and the Hot Design client a Debug build references, are built against the .87 projection revision (WinRT.Runtime 2.3). The .NET 10 SDK (10.0.302 and 10.0.401) gives apps and libraries .57 (WinRT.Runtime 2.2). The .NET 11 SDK already defaults to .87.

Fix (Uno.Common.WinAppSdk.targets, so both apps and class libraries get it)

  • The Uno.Sdk sets WindowsSdkPackageMinimumRevision to 87 unless the project sets it. This is the .NET SDK's own setting:
    • it raises an older default to .87 and never lowers a newer one;
    • it keeps each target framework's Windows SDK build (10.0.26100.87, 10.0.19041.87, …), so it doesn't pin one package version as the issue's workaround does;
    • WindowsSdkPackageVersion, or a project's own minimum, still overrides it.
  • The value has to follow the projection revision Uno's Windows assemblies are built against; the comment next to it says so.

Validation (.NET SDK 10.0.302, fresh template projects, no workaround; this targets file swapped into the published Uno.Sdk 7.0.0-dev.113, whose copy matches master):

Project Uno.Sdk dev.113 dev.113 + this PR
unoapp -preset blank -platforms windows, Debug fails: CS1705 on Uno.UI.HotDesign.Client, then WMC9999 builds, projection 10.0.26100.87
same app, Release builds
unolib, net10.0-windows10.0.26100 builds, projection 10.0.26100.87

Checked directly against the .NET SDK: WindowsSdkPackageMinimumRevision=87 resolves 10.0.26100.87, while a minimum of 40 leaves its default 10.0.26100.57. The apps were built, not launched.

PR Checklist ✅

🤖 Generated with Claude Code


This is an automatic backport of pull request #25836 done by [Mergify](https://mergify.com).

Uno's Windows assemblies, and the Hot Design client a Debug build
references, are built against the .87 Windows SDK projection
(WinRT.Runtime 2.3). The .NET 10 SDK gives apps and libraries .57
(WinRT.Runtime 2.2), so their Windows head failed with CS1705.

The Uno.Sdk now sets WindowsSdkPackageMinimumRevision to 87, which raises
an older default and keeps each target framework's Windows SDK build,
without lowering what a newer .NET SDK picks.

Fixes #24905

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
(cherry picked from commit b724b72)
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

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