microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Crash on Windows when closing a .NET MAUI modal page using — Win32 exception 0xc000027b in Microsoft.ui.xaml.dll

Open sybaris opened this issue 1 month ago • 2 comments

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

  1. Open the sample project.
  2. Run the app on Windows.
  3. Open the modal page (By clicking the rigth top button ).
  4. Click the Cancel button
  5. The application closes immediately with a Win32 exception. (Visual Studio can trap this exception)

Actual behavior

Apps crash

Expected behavior

No crash

Screenshots

Image

NuGet package version

None

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

sybaris avatar Dec 01 '25 16:12 sybaris

Hi @sybaris , can you please attach the sample project link? I can't find it in the description.

ayushjai19 avatar Dec 04 '25 15:12 ayushjai19

Sorry, here the file

_pc.zip

sybaris avatar Dec 04 '25 18:12 sybaris

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.

Image

KoalaBear84 avatar Dec 17 '25 09:12 KoalaBear84

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

sybaris avatar Dec 20 '25 10:12 sybaris