我在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)
有任何想法吗?