question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WinUI: Pushing the same page instance onto a NavigationPage after popping it causes a crash.

See original GitHub issue

Description

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

  1. Create a MAUI app.
  2. 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);
}
  1. 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" />
  1. Click the Button.
  2. Press the back button.
  3. Click the button.
  4. 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:closed
  • Created a year ago
  • Reactions:10
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
drasticactionscommented, Jun 2, 2022

Updated the title. MAUI uses WinUI, not UWP.

1reaction
omghbcommented, Apr 27, 2023

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found