dotnet / dotnet/maui

Re-enable trimming for Microsoft.Maui.Controls.Xaml

Open
#35,206 0 comments 0 reactions 0 assignees View on GitHub
area-xaml perf/app-size t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

## Background

In PR #34573, `false` was removed from four AOT-compatible assemblies (Microsoft.Maui, Microsoft.Maui.Controls.Core, Microsoft.Maui.Controls.Xaml, Microsoft.Maui.Graphics). However, this caused the Windows `Controls.DeviceTests-packaged` Helix work item to hang for 2+ hours and be killed.

As a workaround, `false` was restored on **Microsoft.Maui.Controls.Xaml only** so the PR could merge without regressions. The other three assemblies are now correctly trimmable.

## Task

Root-cause the Windows packaged `Controls.DeviceTests` hang when `Microsoft.Maui.Controls.Xaml` participates in trimming, and re-enable trimming for that assembly.

Reproduction:
1. Remove the `false` from `src/Controls/src/Xaml/Controls.Xaml.csproj`.
2. Run the Windows `Controls.DeviceTests-packaged` work item via `maui-pr-devicetests`.
3. Observe the work item hanging until XHarness timeout.

Contributor guide

Open the contributing guide

Research direction

Start with src/Controls/src/Xaml/Controls.Xaml.csproj and remove the IsTrimmable=false setting, then run the Windows Controls.DeviceTests-packaged work item via maui-pr-devicetests. Trace the cause of the XHarness hang and re-enable trimming for Microsoft.Maui.Controls.Xaml without reproducing the timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.