Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App crashes without throwing any exception in windows phone 8.1 xaml

I am creating a Windows phone 8.1 xaml application. And I used SlideView : a Facebook-like panel for Windows Phone. But app crashes each time while i navigating to a new page by a button click which is placed inside slide view. Navigation is successful from the button outside view.

The bad thing is like that it is not throwing any type of exceptions or details. Even it is not not hitting in the App UnhandledException event.

    public App()
    {
        this.InitializeComponent();          
        this.UnhandledException += App_UnhandledException;
    }

    void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
       //not throwing exception here
    }

I want to know, when will happen this condition ? How to get the exception details of which results app crash ? I can fix the problem if I am able to get the exact issue.

Please provide me the solution. My sample is here

like image 459
asitis Avatar asked Dec 31 '14 06:12

asitis


1 Answers

I don't know why but... If you simply add something to the secnod page and the problem goes away.

<Grid>
    <TextBlock Text="second" />
</Grid>

I too cannot capture the exception anywhere. I had similar issues before and what I had to was removing code piece by piece to make the exception go away... Clearly something is not right in the WinRT framework.

Update

No, the above answer still doesn't fix it. After some further investigation, I've found the right way to get rid of the crash is to call the Dispatcher. I believe this is a bug introduced in update 1. Please see this link for reference.

private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => Frame.Navigate(typeof(second)));
}
like image 176
Justin XL Avatar answered Oct 04 '22 21:10

Justin XL