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
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
Actual behavior
Apps crash
Expected behavior
No crash
Screenshots
NuGet package version
None
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response