0

I have a windows 10 UWP app and hockey app SDK integrated in it. I am unable to find the exact reason why app is crashing. I am providing the Hockey app crash log, please help me to fix the issue.

This is happening after installing and opening the app for the first time. From the next time onwards app is opening and not crashing and working fine.

Below is the hockey app crash log.

Microsoft.HockeyApp.Extensibility.Windows.UnhandledExceptionTelemetryModule.CoreApplication_UnhandledErrorDetected(Object sender, ApplicationModel.Core.UnhandledErrorDetectedEventArgs e)

Application Specific Information:

The application called an interface that was marshalled for a different thread. (Excep_FromHResult 0x8001010E)

Exception Stack:

Binary Images:
0x00007ffc23610000-0x00007ffc2500d000+Win.Appunknown<039259f40c314ebda8ccf39e237ab5c01>D:\xxx\xx\xx\Win.App\obj\x64\Staging\ilc\intermediate\Native\Win.App.pdb.

Thanks in advance.

Nic3500
  • 8,144
  • 10
  • 29
  • 40
Suresh
  • 13
  • 7
  • Turn on "break on first chance exceptions" in VS and you should find your error. Most likely you have an event handler that is called on a background thread and you are trying to update some XAML UI (or the ViewModel that's bound to the UI) in the handler. If so, just use `Dispatcer.RunAsync(…)` to run your code. – Peter Torr - MSFT Oct 22 '18 at 02:39

1 Answers1

1

You must call your method in UI Thread.

This solve my problem :

        await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
        {
           //Run Your code Here
        });
Parsa Karami
  • 702
  • 1
  • 8
  • 30
  • hockey app crash log is not giving any thing in which method the crash is happening. For which method i have to call in UI thread. – Suresh Oct 16 '18 at 04:27
  • so, See what method interact directly with UI (for example changing some text or picture in your code) – Parsa Karami Oct 16 '18 at 06:16
  • See dangers or using `MainView` in response to [this question](https://stackoverflow.com/questions/51602879/how-do-you-find-the-main-window-thread-in-uwp/51603254#51603254). – Peter Torr - MSFT Oct 22 '18 at 02:38