Skip to content

fix: suppress IL2026/IL2104/IL2121 trim analysis warnings on TodoApp.Uno browserwasm/ios/maccatalyst#548

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

fix: suppress IL2026/IL2104/IL2121 trim analysis warnings on TodoApp.Uno browserwasm/ios/maccatalyst#548
adrianhall merged 1 commit into
CommunityToolkit:mainfrom
adrianhall:issues/534

Conversation

@adrianhall

Copy link
Copy Markdown
Collaborator

Summary

Now that #533 fixes the TodoApp.Uno build failure, the browserwasm, ios, and maccatalyst heads build successfully in CI for the first time - and surface IL trim-analyzer warnings (IL2026/IL2104/IL2121) that were previously masked by the build failure. 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 bugs in the sample.

Same fix pattern as #531 (TodoApp.Avalonia/TodoApp.MAUI): add SuppressTrimAnalysisWarnings, scoped via the same GetTargetPlatformIdentifier-conditional pattern already used in TodoApp.MAUI.csproj, to the three confirmed-affected TFMs.

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

Fixes #534

Verification

  • net10.0-desktop: dotnet restore/build clean, no workload required - confirms the change doesn't regress unrelated heads.
  • net10.0-browserwasm: dotnet 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).
    • Negative control: reverted the fix and rebuilt clean -> IL2026/IL2104/IL2121 appeared 18 times. Restored the fix and rebuilt clean -> 0 occurrences, build still succeeded. Confirms the suppression is actually responsible for the fix, not incidental.
  • Root Datasync.Toolkit.sln (unaffected by this change, TodoApp.Uno isn't part of it): restores/builds clean. CommunityToolkit.Datasync.Client.Test passes 1432/1432. CommunityToolkit.Datasync.Server.Test Live DB suites (AzureSQL/PgSQL/MongoDB/CosmosDB) fail in this sandbox due to no Docker daemon - a 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.

…Uno browserwasm/ios/maccatalyst

Now that CommunityToolkit#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 CommunityToolkit#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 CommunityToolkit#531/CommunityToolkit#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 CommunityToolkit#534
@adrianhall adrianhall merged commit a1281d4 into CommunityToolkit:main Jul 10, 2026
19 checks passed
@adrianhall adrianhall deleted the issues/534 branch July 10, 2026 16:31
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.

TodoApp.Uno: trim analysis warnings (IL2026/IL2104/IL2121) on browserwasm/ios/maccatalyst heads

1 participant