简体   繁体   中英

Windows Phone App Crash

I recently uploaded a game to the Windows Phone Marketplace and after a few days I got a crash report with the following Exception system.invalidoperationexception and the following stack trace report

0        Microsoft.Phone.ni.dll    System.Windows.Navigation.NavigationService.GoForwardBackCore        0x000bcb8e    
1        Microsoft.Phone.ni.dll    System.Windows.Navigation.NavigationService.GoBack                   0x000000ec    
2        BlocksPhone.ni.DLL        BlocksPhone.MainPage.btnExitClick                                    0x0000001e    
3        System.Windows.ni.dll     System.Windows.Controls.Primitives.ButtonBase.OnClick                0x00000030    
4        System.Windows.ni.dll     System.Windows.Controls.Button.OnClick                               0x0000001e    
5        System.Windows.ni.dll     System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp    0x00000132    
6        System.Windows.ni.dll     System.Windows.Controls.Control.OnMouseLeftButtonUp                  0x00000034    
7        System.Windows.ni.dll     MS.Internal.JoltHelper.FireEvent                                     0x00000334

I understand that the app could crash because of the exit button click event but I am unsure of what exactly would have caused the crash. Report says that the crash was on Apollo Version. This is my exit button click event..

private void btnExitClick(object sender, RoutedEventArgs e)
{
  this.NavigationService.GoBack();
}

Calling GoBack() when CanGoBack is false will throw this exception. Also, This is not the right way to exit your app because it will throw InvalidOperationException when called in your MainPage .

Read Exiting a Windows Phone Application for several methods to correctly exit a WP app.

Maby forget put to some inization code to
protected override void OnNavigatedTo(NavigationEventArgs e) and application crash for uninitalized control.

Apollo is WP8.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM