How do I get crash logs and stack traces from WinRT apps written in C#?

Deadly 提交于 2019-12-12 08:44:10

问题


I have just started working on a Windows Store App written in C#, it has not yet been published to the Windows Store. When I give a debug build of the app being developed to my testing team and it crashes where can they find the crash log and stack trace? Do I need to do anything when building my application? I'm looking for the standard solution, not a third party library or something that sends me reports from end-users. I'm coming from an Android world where the ADB logcat always contains the Java stack trace, I'm looking for the equivalent in C#/WinRt.


回答1:


Crash dumps will contain the callstack and much more.

To collect crash dumps, first, execute the following regedit script:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"="C:\\Temp\\CrashDumps"
"DumpCount"=dword:00000002
"DumpType"=dword:00000002

Second, reproduce the crash.

Third, stop crash dump recollection by executing:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"=-
"DumpCount"=-
"DumpType"=-

Fourth, get the crash dump from C:\Temp\CrashDumps

More info at MSDN.



来源:https://stackoverflow.com/questions/15797671/how-do-i-get-crash-logs-and-stack-traces-from-winrt-apps-written-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!