Skip to content

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

Merged
MartinZikmund merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/winsdk-projection-revision
Nov 5, 2026
Merged

MartinZikmund merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/winsdk-projection-revision

Conversation

@ramezgerges

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

@unodevops

Copy link
Copy Markdown
Contributor

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

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 242342 has failed on Uno.UI - CI.

@ramezgerges

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@ramezgerges
ramezgerges force-pushed the dev/rara/winsdk-projection-revision branch from 0f2f73b to a052162 Compare November 2, 2026 15:09
@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges
ramezgerges enabled auto-merge November 2, 2026 16:39
@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 242863 has failed on Uno.UI - CI.

@ramezgerges
ramezgerges force-pushed the dev/rara/winsdk-projection-revision branch from a052162 to 0dfa38d Compare November 3, 2026 16:55
@unodevops

Copy link
Copy Markdown
Contributor

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

@MartinZikmund MartinZikmund added the 7.0 PRs only. For issues, use the Release field. label Nov 4, 2026
@MartinZikmund

Copy link
Copy Markdown
Member

@Mergifyio backport release/stable/7.0

@mergify

mergify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/7.0

✅ Backports have been created

Details

@ramezgerges
ramezgerges force-pushed the dev/rara/winsdk-projection-revision branch from 0dfa38d to b724b72 Compare November 4, 2026 18:21
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 unoplatform#24905

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

Copy link
Copy Markdown
Contributor

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

@MartinZikmund
MartinZikmund merged commit 8e5b0bd into unoplatform:master Nov 5, 2026
45 of 52 checks passed
agneszitte added a commit to unoplatform/Uno.Themes that referenced this pull request Nov 9, 2026
Uno.Sdk 7.0.29 sets WindowsSdkPackageMinimumRevision to 87 (unoplatform/uno#25836),
the same 10.0.19041.87 projection this block selected. Setting WindowsSdkPackageVersion
as well fails with NETSDK1230 (unoplatform/uno#26174).
MartinZikmund pushed a commit to ramezgerges/uno that referenced this pull request Nov 10, 2026
Since unoplatform#25836 the Uno.Sdk sets WindowsSdkPackageMinimumRevision to 87 on Windows
targets, even when the project already picked WindowsSdkPackageVersion. The .NET SDK
rejects both together, so every such project failed with NETSDK1230. The default now
applies only when the project picked no version.
MartinZikmund pushed a commit to ramezgerges/uno that referenced this pull request Nov 10, 2026
Uno.Sdk 7.0 sets WindowsSdkPackageMinimumRevision (unoplatform#25836), so a project that still
sets WindowsSdkPackageVersion fails with NETSDK1230 (unoplatform#26174), and a .57 projection,
as the 6.0 migration guide suggested, fails with CS1705. Documents it in the 7.0
migration guide (section, checklist, error lookup) and on the pages that set it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.0 PRs only. For issues, use the Release field.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fresh 7.0 dev app fails to build its WinAppSDK head with CS1705 (WinRT.Runtime 2.3.1 vs 2.2.0)

4 participants