Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation.PushAsync(); on windows platform throws exception: Catastrophic failure (0x8000FFFF (E_UNEXPECTED)) with same page instance #3931

Closed
mfe- opened this issue Jan 4, 2022 · 1 comment
Labels
area-navigation NavigationPage platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@mfe-
Copy link

mfe- commented Jan 4, 2022

Description

Navigation.PushAsync(); throws exception: Catastrophic failure (0x8000FFFF (E_UNEXPECTED)) on the windows platform if a singleton instance of the page is provided. Cannot reproduced on android.

Steps to Reproduce

Repo: https://github.com/mfe-/MauiApp1-Noinstalledcomponentsweredetected

  1. create a new dotnet maui project with visual studio 2022
  2. add a second contentpage (in this repo the name of the second contentpage is NewGamePage.xaml
  3. In App.xaml.cs replace MainPage = new MainPage() with MainPage = new NavigationPage(new MainPage());
  4. In MainPage.xaml.cs replace the content of OnCounterClicked with
        public static Page page;
        private void OnCounterClicked(object sender, EventArgs e)
        {
            try
            {
                count++;
                CounterLabel.Text = $"Current count: {count}";
                SemanticScreenReader.Announce(CounterLabel.Text);
                if (App.Current.MainPage is NavigationPage navigationPage)
                {
                    if (MainPage.page == null)
                    {
                        MainPage.page = new NewGamePage();
                    }
                    navigationPage.CurrentPage.Navigation.PushAsync(MainPage.page);
                }
            }
            catch(Exception ex)
            {
                System.Console.WriteLine(ex);
            }

        }
  1. build and run the app on the windows platform
  2. click on button click me
  3. click left arrow back button
  4. click again on click me
  5. App.g.i.cs throws
  6. exception: Catastrophic failure (0x8000FFFF (E_UNEXPECTED)) Microsoft.UI.Xaml.Controls.Frame.NavigationFailed was unhandled.

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

10.0.19041

Did you find any workaround?

Don't use a singleton for the page instance.

Relevant log output

¤ .NET MAUI Check v0.10.0.0 ¤
------------------------------------------------------------------------------------------------------------------------
This tool will attempt to evaluate your .NET MAUI development environment.
If problems are detected, this tool may offer the option to try and fix them for you, or suggest a way to fix them
yourself.

Thanks for choosing .NET MAUI!
------------------------------------------------------------------------------------------------------------------------
» Synchronizing configuration... ok
» Scheduling appointments... ok

> OpenJDK 11.0 Checkup...
  - 11.0.12 (C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\..)
  - Set Environment Variable: JAVA_HOME=C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot

> Visual Studio 17.1.0-pre.1.0 Checkup...
  - 17.1.0-pre.1.1 - C:\Program Files\Microsoft Visual Studio\2022\Preview

> Android SDK Checkup...
  - emulator (29.3.0)
  x build-tools;31.0.0 (31.0.0) missing.
  - platforms;android-31 (1)
  x system-images;android-31;google_apis;x86_64 (6) missing.
  - platform-tools (31.0.3)
  - cmdline-tools;5.0 (5.0)

------------------------------------------------------------------------------------------------------------------------
¤ Recommendation: Install or Update Android SDK packages
Your Android SDK has missing or outdated packages.
You can use the Android SDK Manager to install / update them.
For more information see: https://aka.ms/dotnet-androidsdk-help
------------------------------------------------------------------------------------------------------------------------

! Attempt to fix? [y/n] (y): n

x Skipped: Android Emulator

> .NET SDK Checkup...
  - 2.1.600-preview-009497 - C:\Program Files\dotnet\sdk\2.1.600-preview-009497
  - 2.1.600 - C:\Program Files\dotnet\sdk\2.1.600
  - 2.1.601 - C:\Program Files\dotnet\sdk\2.1.601
  - 2.1.602 - C:\Program Files\dotnet\sdk\2.1.602
  - 2.1.801 - C:\Program Files\dotnet\sdk\2.1.801
  - 2.2.200-preview-009804 - C:\Program Files\dotnet\sdk\2.2.200-preview-009804
  - 2.2.200 - C:\Program Files\dotnet\sdk\2.2.200
  - 2.2.201 - C:\Program Files\dotnet\sdk\2.2.201
  - 2.2.202 - C:\Program Files\dotnet\sdk\2.2.202
  - 2.2.401 - C:\Program Files\dotnet\sdk\2.2.401
  - 3.0.100 - C:\Program Files\dotnet\sdk\3.0.100
  - 5.0.103 - C:\Program Files\dotnet\sdk\5.0.103
  - 6.0.100 - C:\Program Files\dotnet\sdk\6.0.100

> .NET SDK - Workload Deduplication Checkup...

> Edge WebView2 Checkup...
  - Found Edge WebView2 version 96.0.1054.62

> .NET SDK - Workloads (6.0.100-rtm.21527.11) Checkup...
  x android-aot (Microsoft.NET.Sdk.Android.Manifest-6.0.100 : 31.0.101-preview.10.61) not installed.
  x ios (Microsoft.NET.Sdk.iOS.Manifest-6.0.100 : 15.0.101-preview.10.249) not installed.
  x maccatalyst (Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.100 : 15.0.101-preview.10.249) not installed.
  x tvos (Microsoft.NET.Sdk.tvOS.Manifest-6.0.100 : 15.0.101-preview.10.249) not installed.
  x macos (Microsoft.NET.Sdk.macOS.Manifest-6.0.100 : 12.0.101-preview.10.249) not installed.
  - maui (Microsoft.NET.Sdk.Maui.Manifest-6.0.100 : 6.0.101-preview.10.2068) installed.
  - wasm-tools (microsoft.net.workload.mono.toolchain.manifest-6.0.100 : 6.0.0) installed.
  - microsoft-net-sdk-emscripten (microsoft.net.workload.emscripten.manifest-6.0.100 : 6.0.0) installed.
! Managing Workload installation from the CLI is NOT recommended.  Instead you should install the latest Visual Studio
preview to automatically get the newest release of .NET MAUI workloads installed.
Are you sure you would like to continue the CLI workload installation? [y/n] (n): n
@mfe- mfe- added the t/bug Something isn't working label Jan 4, 2022
@PureWeen PureWeen added the fatal label Jan 5, 2022
@shimingsg
Copy link

Not reproducible with windows 10.0.19041.

@shimingsg shimingsg added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Feb 18, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-navigation NavigationPage platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants