[英]uwp app (.net native) and unhandled exception
我為Windows 10桌面創建了uwp app(.Net native)。 我使用HockeyApp收集實時崩潰報告。 堆棧跟蹤不提供信息。 這是一個長期存在的問題,並沒有解決方案。 我嘗試了這個,但它不起作用。 我得到以下例外:
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
Arg_NullReferenceException
Microsoft.HockeyApp.Extensibility.Windows.UnhandledExceptionTelemetryModule.CoreApplication_UnhandledErrorDetected
The parameter is incorrect. The parameter is incorrect.
在我的計算機上,應用程序運行穩定。 也許這是由於Windows的版本。 我認為這是由於我的xaml。 對我來說糾正這些錯誤非常重要。 但我不能拒絕這張桌子。 任何想法如何找到這些錯誤的來源?
對不起,這可能不是答案,但我在評論欄中沒有足夠的空間。
在App.xaml.cs
嘗試以下操作。 為這些事件添加處理程序,看看他們是否向您報告崩潰事件。
public App()
{
UnhandledException += OnUnhandledException;
TaskScheduler.UnobservedTaskException += OnUnobservedException;
InitializeComponent();
}
private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
// Occurs when an exception is not handled on the UI thread.
// if you want to suppress and handle it manually,
// otherwise app shuts down.
e.Handled = true;
}
private static void OnUnobservedException(object sender, UnobservedTaskExceptionEventArgs e)
{
// Occurs when an exception is not handled on a background thread.
// ie. A task is fired and forgotten Task.Run(() => {...})
// suppress and handle it manually.
e.SetObserved();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.