Tanuj Wadhwa
Tanuj Wadhwa

Reputation: 2045

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();
}

Upvotes: 0

Views: 579

Answers (2)

Alaa Masoud
Alaa Masoud

Reputation: 7135

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

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

Upvotes: 2

user131077
user131077

Reputation:

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

Apollo is WP8.

Upvotes: 0

Related Questions