Crash on Windows when closing a .NET MAUI modal page using — Win32 exception 0xc000027b in Microsoft.ui.xaml.dll
Describe the bug
Summary
In a .NET MAUI application running on Windows (WinUI 3), closing a modal page using Navigation.PopModalAsync() causes a fatal Win32 exception. This happens only on Windows — Android works without any issue.
The exception is thrown after clicking a Cancel button on a modal dialog page. The crash occurs inside Microsoft.ui.xaml.dll, not in user code.
I have reproduced the issue in a minimal project, attached here.
Environment Platform: Windows 11 (25H2 build 26200.7171) .NET MAUI: .NET 8 Windows App SDK: Microsoft.WindowsAppRuntime 1.5.5 WinUI: Microsoft.UI.Xaml 3.1.5.0 Architecture: win10-x64 AppX Crash only occurs on Windows (Android works correctly)
Why is this important?
My apps crashs
Steps to reproduce the bug
- Open the sample project.
- Run the app on Windows.
- Open the modal page (By clicking the rigth top button ).
- Click the Cancel button
- The application closes immediately with a Win32 exception. (Visual Studio can trap this exception)
Actual behavior
Apps crash
Expected behavior
No crash
Screenshots
NuGet package version
None
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response
Hi @sybaris , can you please attach the sample project link? I can't find it in the description.
This might be related. I'm getting a lot a crashes which are related to hovering over the W11 Taskbar, and I'm not fully sure the exact thing to reproduce. But the taskbar makes Explorer.exe crash 10-20 times a day on Windows.UI.Xaml.dll also on 0xc000027b with the following event log:
Faulting application name: Explorer.EXE, version: 10.0.26100.6725, time stamp: 0x4db8029a
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.26100.6725, time stamp: 0xe73588b5
Exception code: 0xc000027b
Fault offset: 0x00000000008fdf13
Faulting process id: 0x28C88
Faulting application start time: 0x1DC6E8CFF7895DC
Faulting application path: C:\WINDOWS\Explorer.EXE
Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll
Report Id: 2f5c4f8d-6adb-4fb0-b270-70daf036a0ae
Faulting package full name:
Faulting package-relative application ID:
It started happening around the 11th. No Windows updates around that time, so it's strange.
Even after migrating the project to MAUI 9, I have the same problem.
What I have in windows eventlog :
Nom de l'application défaillante : pCloudPhotoOrganizer.exe, version : 1.0.0.0, horodatage : 0x68d50000
Nom du module défaillant : Microsoft.ui.xaml.dll, version : 3.1.5.0, horodatage : 0x69b4a9aa
Exception code: 0xc000027b
Fault offset: 0x0000000000405295
Identifiant du processus défaillant : 0xA450
Heure de début de l'application défaillante : 0x1DC7197478E5EC3
Chemin de l'application défaillante : C:\_pc\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\AppX\pCloudPhotoOrganizer.exe
Chemin du module défaillant : C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.5_5001.373.1736.0_x64__8wekyb3d8bbwe\Microsoft.ui.xaml.dll
ID du rapport : b45d7a7e-9b71-48a8-b3ad-b4dd23f8d807
Nom complet du package défaillant : com.companyname.pcloudphotoorganizer_1.0.0.1_x64__9zz4h110yvjzm
Package défaillant – ID d'application relatif : App