question

zipswich avatar image
0 Votes"
zipswich asked NicoZhu-MSFT commented

Frame.GoBack() occasionally throws "Exception: Unspecified error (Exception from HRESULT: 0x80004005)"

 if (Frame.CanGoBack)
 {
    Frame.GoBack();
 }

The above code works fine usually, but Frame.GoBack() occasionally throws the following:

System.Exception: Unspecified error (Exception from HRESULT: 0x80004005)
Stack Trace:
at System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
at __Interop.ComCallHelpers.Call(__ComObject, RuntimeTypeHandle, Int32) + 0xb8
at __Interop.ForwardComStubs.Stub_11[TThis](__ComObject, Int32) + 0x24

Could anyone shed some light on the possible causes?

windows-uwp
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please set debug point in current page OnNavigatedFrom method, and previous page OnNavigatedTo method to detect if there is exception, or use try-catch block to pack

 if (Frame.CanGoBack)
  {
     Frame.GoBack();
  }

told user exception throwing, and try to go back again.

0 Votes 0 ·

Thank you for the tip. Actually, the app is already doing repeated tries (3 times in total with an interval of 10 ms). Perhaps the interval should be increased.

0 Votes 0 ·

Yep, your thread is correct, and you could also for-each current navigation stack, and check if item is available.

0 Votes 0 ·

0 Answers