小编d.l*_*ysh的帖子

WinRT的.UnhandledException处理程序.StackTrace为null

我在WinForms上有一个带有以下代码的项目:

AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;

private void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{            }
Run Code Online (Sandbox Code Playgroud)

e.ExceptionObject包含完整的堆栈跟踪.

在Win Store项目中:

this.UnhandledException += (s, e) =>{                                               
{                                              
    MarkedUp.AnalyticClient.LogLastChanceException(e);
};
Run Code Online (Sandbox Code Playgroud)

e.Exception.StackTrace为null.

这两个例外都是由这段代码生成的:

int a=0;
....

try
{
    int i = 1 / a;
}
catch (Exception exp)
{
    throw;
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

windows-runtime windows-store windows-store-apps

5
推荐指数
1
解决办法
674
查看次数