Closed pekspro closed 8 years ago
I believe this problem is causing my app to fail the Prelaunch test in the Windows App Certification Kit.
This if ((OriginalActivatedArgs as LaunchActivatedEventArgs)?.PrelaunchActivated ?? false)
will be part of 1.1.4 when it is pushed to NuGet. It is already in GitHub. Perhaps you could verify?
I verified that my app no longer crashes with the steps above. Thanks!
Great, I will update the pack soon.
The crash is gone, but it still doesn’t behave correctly. You will get stuck in the splash screen when the app is resumed.
I also found line 109-100 in bootstrapper.cs probably would look like this:
DebugWrite($"Calling. Prelaunch {(OriginalActivatedArgs as LaunchActivatedEventArgs)?.PrelaunchActivated ?? false}", caller: "OnSuspendingAsync");
await OnSuspendingAsync(s, e, (OriginalActivatedArgs as LaunchActivatedEventArgs)?.PrelaunchActivated ?? false);
In HambugerMenu.xaml.cs there is these line which I assume also will crash if OriginalActicatedArgs is null (if that’s possible, I’m not sure):
if (_navigationService.FrameFacade.BackStackDepth == 0
&& BootStrapper.Current.SplashFactory != null
&& BootStrapper.Current.OriginalActivatedArgs.PreviousExecutionState != Windows.ApplicationModel.Activation.ApplicationExecutionState.Terminated)
That said, this doesn't explain why you get stuck in the splash screen :-(.
The latest release causes a crash when PreLaunch is used. This is easy to replicate in the "Tiles (and Toast)" sample (probably all samples, but this is the one I tested).
• Launch this sample with Debug -> Other debug targets -> Debug Universal Windows App Launch. • In Lifecycle Events select Suspend. • Wait at least 10 seconds. • In Lifecycle Event select Resume. • A null reference exception will now occur in BootStraper.cs, because of OriginalActivatedArgs is null line 86: