WinUI app release version using multiselection SfComboBox crashes

I just create for demostartion a new app from scratch.

When I run it from debugger, works as inteded.

When I press Ctrl+F5 (Run without debugging) a release version, it crashes.

C# page code includes:

public class TestItem
{
    public int Id { get; set; } = -1;
    public string Name { get; set; } = string.Empty;
}

private ObservableCollection<TestItem> _Source = null;
public ObservableCollection<TestItem> Source
{
    get
    {
        if (_Source == null)
        {           
             _Source = new ObservableCollection<TestItem>();
            for (int i = 0; i < 25; i++)
            {
                _Source.Add (new TestItem() Id = i, Name = $"Name {i}"); 
             }
        }
        return _Source;
    }
}

XAML code

<Grid x:Name="MainGrid" >

    <sfe:SfComboBox x:Name="TestComboBox" ItemsSource="{x:Bind Source}" DisplayMemberPath="Name" SelectionMode="Multiple"/>

</Grid>


Attachment: sftest_7f46e687.zip


1 Reply

SN Sudharsan Narayanan Syncfusion Team April 7, 2025 11:40 AM UTC

Hi Imre Mátyásföldi,

We were able to reproduce the reported issue. On further analysis, it occurs only when the 'PublishTrimmed' property is set to true on the application side. If we remove the 'PublishTrimmed' setting from the project file, the application runs without any issues.

Additionally, we have logged this issue with the Microsoft team, as it occurs specifically when using a custom control with the 'PublishTrimmed' property set to true. You can track the issue here: AOT throws exception when using the custom control · Issue #10409 · microsoft/microsoft-ui-xaml

We will keep you updated once the issue is resolved and included in one of our upcoming releases. Thank you for your patience and understanding in the meantime.

Regards,
Sudharsan


Loader.
Up arrow icon