microsoft / microsoft/microsoft-ui-xaml
Crash on Windows when closing a .NET MAUI modal page using — Win32 exception 0xc000027b in Microsoft.ui.xaml.dll
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### 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
### NuGet package version
None
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.