Skip to content

[Windows] Border containing SwipeView causes native crash (0xc000027b) with simple content such as Editor or CollectionView #36652

Description

@kamano1

Description

When a SwipeView is placed inside a Border, the application crashes on Windows during startup with exit code 3221226107 (0xc000027b).

This issue was discovered while developing a MAUI application targeting both Android and Windows.

The same XAML works correctly on Android, but crashes immediately on Windows Machine.

Several existing issues appear to be related to SwipeView crashes on Windows, however this report provides a much simpler reproduction case that requires only a few lines of XAML.

One of the most problematic aspects of this issue is that there is no managed exception or warning. The application terminates due to a native crash, which makes root cause analysis extremely difficult and can lead developers to spend a significant amount of time investigating unrelated code.

The issue is not limited to Editor. Replacing the Editor with other controls such as CollectionView also reproduces the same crash.

Based on testing, the problem appears to be related to the visual hierarchy:

Works:
SwipeView -> Border -> Content

Crashes:
Border -> SwipeView -> Content

Steps to Reproduce

  1. Create a new .NET MAUI application from the default template.
  2. Replace MainPage.xaml with the sample below.
  3. Replace MainPage.xaml.cs with the minimal code below.
  4. Set build configuration to Debug.
  5. Select "Windows Machine" as the debug target.
  6. Start debugging.

Expected result:
Application starts normally.

Actual result:
Application terminates immediately with exit code 3221226107 (0xc000027b).

MainPage.xaml

<ContentPage
    x:Class="MauiApp1.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
    <Border Stroke="DarkGray"
            StrokeThickness="1">
        <SwipeView Threshold="80">
            <SwipeView.LeftItems>
                <SwipeItems Mode="Execute">
                    <SwipeItem Text="Back" />
                </SwipeItems>
            </SwipeView.LeftItems>
            <Editor />
        </SwipeView>
    </Border>
</ContentPage>

MainPage.xaml.cs

namespace MauiApp1;

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
    }
}

Link to public reproduction project repository

No response

Version with bug

10.0.80

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 11

Did you find any workaround?

Yes.

Moving the Border inside the SwipeView avoids the crash.

Crashing structure:

Border
└ SwipeView
└ Content

Working structure:

SwipeView
└ Border
└ Content

Example

<SwipeView>
    <SwipeView.LeftItems>
        <SwipeItems Mode="Execute">
            <SwipeItem Text="Back" />
        </SwipeItems>
    </SwipeView.LeftItems>
    <Border Stroke="DarkGray"
            StrokeThickness="1">
        <Editor />
    </Border>
</SwipeView>

Relevant log output

The program exited with code 3221226107 (0xc000027b).
No managed exception was raised before the crash.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions