How to analyse WERInternalMetadata.xml file generated by Windows Crash Reporter?

前端 未结 1 1705
太阳男子
太阳男子 2020-12-16 15:42

A .Net 4.0 app keeps crashing for a user, but just for him, I could not reproduce the bug. He attached the WERInternalMetadata.xml file generated by the Windows

1条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-16 15:53

    Firstly, here's what's in that WER trace:

    rstvshowtracker.exe - your exe
    1.0.3842.33258 - version of your exe
    4c374e79 - exe timestamp
    mscorlib - assembly / module
    4.0.0.0 - assembly version
    4ba1da6f - assm timestamp
    1620 - methodDef token of faulting method 
    14 - IL offset of faulting instruction
    System.IO.FileNotFoundException - exception
    

    You could use WinDBG and SOS to find out what that method is (e.g. 1620). See the example here on how to do it: http://blogs.msdn.com/b/oanapl/archive/2009/01/30/windows-error-reporting-wer-and-clr-integration.aspx

    ...Alternatively, you could hook up the unhandledException event in your application, and print out the exception stack trace to a log file, to see what caused the issue; e.g.

    static void MyHandler(object sender, UnhandledExceptionEventArgs args) 
    {
       Exception e = (Exception) args.ExceptionObject;
       // print out the exception stack trace to a log
    }
    
    public static void Main() 
    {
       AppDomain currentDomain = AppDomain.CurrentDomain;
       currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
    }
    

    0 讨论(0)
提交回复
热议问题