Skip to content

fix: resolve TodoApp.Uno Skia build failures and bump Uno Platform 5 -> 6#533

Merged
adrianhall merged 1 commit into
CommunityToolkit:mainfrom
adrianhall:issues/525
Jul 10, 2026
Merged

fix: resolve TodoApp.Uno Skia build failures and bump Uno Platform 5 -> 6#533
adrianhall merged 1 commit into
CommunityToolkit:mainfrom
adrianhall:issues/525

Conversation

@adrianhall

Copy link
Copy Markdown
Collaborator

Summary

Fixes the TodoApp.Uno sample's build failures on Skia-based heads (android, ios, maccatalyst, browserwasm, desktop), and bumps Uno.Sdk 5 -> 6, which resolves two outstanding NU1903 advisories along the way.

Closes #525
Closes #524
Closes #526

What's in here

#525 - EventTriggerBehavior / UXAML0001

Views/TodoListPage.xaml used an EventTriggerBehavior/InvokeCommandAction pair (from Microsoft.Xaml.Interactions.Core) to fire LoadPageCommand on Loaded. This behavior was already dead code - its own comment says "the event is not triggered. Handling in code behind for now", and TodoListPage.xaml.cs's DataContextChangedHandler already calls ViewModel.LoadPageCommand.ExecuteAsync(null) directly.

On every non-Windows (Skia) head, CommunityToolkit.WinUI.Behaviors resolves Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI instead of the real Microsoft.Xaml.Behaviors.WinUI.Managed. I confirmed via NuGet (across every released version, prerelease and stable, including the latest 8.2.251219 CommunityToolkit.WinUI.Behaviors) that the Uno port (unoplatform/Uno.XamlBehaviors) only ever ships Microsoft.Xaml.Interactivity (the base attached-property infrastructure) - it has never shipped a Microsoft.Xaml.Interactions (Core triggers/actions) equivalent. So option 1 from the issue (pin a different version) was a dead end; the fix is to remove the dead behavior block and its now-unused xmlns:interactions namespace.

#524 - Uno Platform 5 -> 6

Bumped Uno.Sdk in global.json from 5.6.54 to 6.5.36 (-> Uno.WinUI 6.5.237). This was necessary, not optional: once the #525 fix let the browserwasm head's build get past the XAML compile stage, it hit a new (previously-masked) failure - Uno.Wasm.Bootstrap 8.0.23 (floored by Uno.WinUI 5.x) hard-rejects any project targeting TargetFrameworkVersion >= 9.0. Uno.Sdk 6.x resolves Uno.Wasm.Bootstrap 10.0.96 instead, which lifts that guard.

Required manual migration per the Uno 6 migration guide:

  • Platforms/Desktop/Program.cs: Uno.UI.Runtime.Skia -> Uno.UI.Hosting, SkiaHostBuilder -> UnoPlatformHostBuilder, .UseWindows() -> .UseWin32().
  • Platforms/Android/Main.Android.cs: removed the UniversalImageLoader configuration - Uno 6 now handles image loading internally via Skia rendering.

#526 - System.Security.Cryptography.Xml NU1903 (browserwasm)

Resolved as a side effect of the #524 bump: System.Security.Cryptography.Xml now resolves to 10.0.7 (up from the vulnerable 8.0.2) on the browserwasm head, confirmed via a clean dotnet restore with no NU1903 warnings.

As a bonus, the bump also resolves the original Tmds.DBus NU1903 finding from #506 on the desktop head (Uno.WinUI.Runtime.Skia.X11 switches to the patched Tmds.DBus.Protocol starting at Uno.WinUI 6.0.465).

CI

Re-enabled the todoapp-uno job (all 5 heads) in build-samples.yml, and removed the stale "disabled pending fix" comments in both workflow files.

Verification

Verified locally:

  • desktop: dotnet restore + dotnet build clean, no workload required.
  • browserwasm: dotnet restore + dotnet build clean, after installing the wasm-tools workload (into a separate user-writable .NET SDK, since the system-wide SDK install wasn't writable in my environment). No NU1903 warnings on restore (confirms Investigate resolving NU1903 for System.Security.Cryptography.Xml in Uno browserwasm sample head #526).
  • Root Datasync.Toolkit.sln (main library, unaffected by this change) still restores and builds clean.

Not verified locally (relying on CI for these, same limitation noted by the original issue reports):

  • android: the android workload installs, but the Android SDK (platform-tools/build-tools) wasn't provisioned in my environment, so the build fails before reaching any application code.
  • ios / maccatalyst: require a full Xcode install (only Command Line Tools available in my environment).
  • windows: requires a Windows runner.

…-> 6

Removes the dead EventTriggerBehavior/InvokeCommandAction Interaction.Behaviors
block in Views/TodoListPage.xaml that caused UXAML0001 (Microsoft.Xaml.Interactions.Core
could not be found) on every Skia-based head (android, ios, maccatalyst,
browserwasm, desktop). The Uno port of XAML Behaviors (unoplatform/Uno.XamlBehaviors)
only ships Microsoft.Xaml.Interactivity, never a Microsoft.Xaml.Interactions.Core
equivalent, in any version - confirmed via NuGet, so pinning a different package
version could never fix this. The behavior was already dead code per its own
comment ("the event is not triggered. Handling in code behind for now") -
TodoListPage.xaml.cs's DataContextChangedHandler already invokes
ViewModel.LoadPageCommand directly. (CommunityToolkit#525)

Also bumps Uno.Sdk from 5.6.54 to 6.5.36 (-> Uno.WinUI 6.5.237) (CommunityToolkit#524), which:
- Resolves the outstanding NU1903 Tmds.DBus 0.16.0 advisory on the desktop head
  for free (Uno.WinUI.Runtime.Skia.X11 switches to patched Tmds.DBus.Protocol
  starting at 6.0.465).
- Lifts the Uno.Wasm.Bootstrap net9.0+ TargetFramework guard that was blocking
  the browserwasm head once the EventTriggerBehavior fix above let restore/build
  get far enough to hit it (Uno.Sdk 6.x resolves Uno.Wasm.Bootstrap 10.0.96
  instead of the 5.x line's 8.0.23).

Required manual migration per https://platform.uno/docs/articles/migrating-to-uno-6.html:
- Platforms/Desktop/Program.cs: Uno.UI.Runtime.Skia -> Uno.UI.Hosting,
  SkiaHostBuilder -> UnoPlatformHostBuilder, UseWindows() -> UseWin32().
- Platforms/Android/Main.Android.cs: removed the UniversalImageLoader
  configuration, which Uno 6 now handles internally via Skia rendering.

Re-enables the todoapp-uno CI job in build-samples.yml (all 5 heads: android,
ios-maccatalyst, windows, browserwasm, desktop), removing the stale
disabled-pending-fix comments in both workflow files.

Verified locally:
- desktop: restore + build clean (no workload required).
- browserwasm: restore + build clean, after installing the wasm-tools workload
  into a separate user-writable .NET SDK (system-wide /usr/local/share/dotnet
  is root-owned in this environment).
- Root Datasync.Toolkit.sln (main library, unaffected by this change) still
  restores and builds clean.

Not verified locally (relying on CI, same limitation the issue reporter noted):
- android: workload installs, but the Android SDK (platform-tools/build-tools)
  isn't provisioned in this environment, so the build fails before reaching any
  application code.
- ios / maccatalyst: require a full Xcode install (only Command Line Tools are
  available here).
- windows: requires a Windows runner.
@adrianhall adrianhall merged commit d068d63 into CommunityToolkit:main Jul 10, 2026
20 checks passed
adrianhall added a commit that referenced this pull request Jul 10, 2026
…Uno browserwasm/ios/maccatalyst (#548)

Now that #533 fixes the TodoApp.Uno build failure, these three heads build
successfully in CI for the first time and surface IL trim-analyzer warnings
that were previously masked. dotnet build enables the trim analyzer on these
SDKs by default, but this CI pipeline only ever runs 'dotnet build', never
'dotnet publish -p:PublishTrimmed=true', so the warnings are diagnostic noise
on framework APIs (EF Core's DbContext ctor, JsonSerializer.Serialize, Uno's
own Hosting/Navigation surface and source-generated BindableMetadata.g.cs),
not sample bugs.

Same fix pattern as #531 (TodoApp.Avalonia/TodoApp.MAUI): add
SuppressTrimAnalysisWarnings, scoped via GetTargetPlatformIdentifier to match
TodoApp.MAUI.csproj's existing convention.

android/desktop/windows did not surface these warnings in the CI run linked
from the issue, so they are intentionally left unsuppressed.

Verified locally:
- net10.0-desktop: restore + build clean (no workload required).
- net10.0-browserwasm: restore + build clean after installing the wasm-tools
  workload into a separate user-writable .NET SDK (system-wide SDK is
  root-owned in this environment). Confirmed via negative control (reverting
  the change) that IL2026/IL2104/IL2121 appear 18 times without the fix and
  0 times with it, on an otherwise identical build.
- Root Datasync.Toolkit.sln (unaffected by this change) still restores and
  builds clean; Client.Test passes 1432/1432. Live server DB tests fail in
  this sandbox due to no Docker daemon (pre-existing environment limitation,
  unrelated to this change).

Not verified locally (relying on CI, same limitation noted in #531/#533):
- ios / maccatalyst: require a full Xcode install (only Command Line Tools
  available here).
- android: requires the Android SDK/workload.
- windows: requires a Windows runner.

Fixes #534

Co-authored-by: ahall <ahall@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant