WinUI: Pushing the same page instance onto a NavigationPage after popping it causes a crash.
See original GitHub issueDescription
UWP only: Push a ContentPage onto a NavigationPage. Pop the page, using the back button. Push the same page again. Exception = {“Catastrophic failure (0x8000FFFF (E_UNEXPECTED))”}
Minimal repro: https://github.com/Keflon/MauiNavigationBugRepro
Steps to Reproduce
- Create a MAUI app.
- Make this change in App.xaml.cs:
public App()
{
InitializeComponent();
//MainPage = new AppShell();
MainPage = new NavigationPage(new MainPage());
}
In MainPage.xaml.cs add the following, where _childPage
is set to an instance of a Maui Page
private void OnNavigateClicked(object sender, EventArgs e)
{
App.Current.MainPage.Navigation.PushAsync(_childPage);
}
- Add a Button in MainPage.xaml that raises the click handler.
<Button
x:Name="NavigateBtn"
Text="UWP Navigate Bug"
SemanticProperties.Hint="Demonstrates a UWP navigation bug"
Clicked="OnNavigateClicked"
HorizontalOptions="Center" />
- Click the Button.
- Press the back button.
- Click the button.
- Notice UWP crashes with Exception = {“Catastrophic failure (0x8000FFFF (E_UNEXPECTED))”}
Version with bug
6.0 (current)
Last version that worked well
Release Candidate 3 (current)
Affected platforms
Windows
Affected platform versions
Latest
Did you find any workaround?
No
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:22 (6 by maintainers)
Top Results From Across the Web
WInUI 3.0 Desktop - Crash on exception when try to navigate
It gives message: "WinUI: Error creating second Desktop Window on the current process. No more than one Desktop Window is allowed per process."....
Read more >NavigationPage - .NET MAUI
Pushed is raised when a page is pushed onto the navigation stack. Popped is raised when when a page is popped from the...
Read more >Peer-to-peer navigation between two pages - Windows apps
Learn how to enable peer-to-peer navigation between two basic pages in an Windows app.
Read more >Navigating Between Pages | Universal Windows Apps with ...
Navigating Between Pages. Although simple apps might have only one Page per window, most windows in real-world apps leverage multiple Pages.
Read more >Drawboard PDF: Release Notes - Windows app
App freezing/crashing due to the highlighter tool; Local document is not getting opened on the window that it was clicked on; Same documents ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Updated the title. MAUI uses WinUI, not UWP.
Please, fix this bug.
It blocks our migration from Xamarin to MAUI for the Windows support. We have not found a workaround to overcome this crash.