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
- Create a new .NET MAUI application from the default template.
- Replace MainPage.xaml with the sample below.
- Replace MainPage.xaml.cs with the minimal code below.
- Set build configuration to Debug.
- Select "Windows Machine" as the debug target.
- 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.
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
Expected result:
Application starts normally.
Actual result:
Application terminates immediately with exit code 3221226107 (0xc000027b).
MainPage.xaml
MainPage.xaml.cs
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
Relevant log output