So when I am creating an App Package, the Windows App Certification Kit fails with:
Crashes and hangs • Error Found: The crashes and hangs test detected
the following errors:◦Application
47878User.MyApp_1.0.0.3_neutral__a2qvk4qzttz7j was detected by Windows
Error Reporting and experienced a crash or hang.
In my event log I see the following:
Application: MyApp.exe Framework Version: v4.0.30319 Description: The
process was terminated due to an unhandled exception. Exception Info:
System.Exception Stack: at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Threading.WinRTSynchronizationContext+Invoker.b__0(System.Object)
at
System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch() at
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
and:
Faulting application name: MyApp.exe, version: 1.0.0.0, time stamp:
0x50546b92 Faulting module name: KERNELBASE.dll, version:
6.2.9200.16384, time stamp: 0x5010ac2f
Exception code: 0xe0434352
Fault offset: 0x00014b32
Faulting process id: 0x1894
Faulting application start time: 0x01cd933a183ece6a
Faulting application path:
C:\Program
Files\WindowsApps\47878User.MyApp_1.0.0.3_neutral__a2qvk0qzyyn7m\MyApp.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll Report Id:
6b9e9db3-ff2d-11e1-be8d-001c42ac6e2f Faulting package full name:
47878User.MyApp_1.0.0.3_neutral__a2qvk0qzyyn7m
The problem is that I can’t for the life of me reproduce any crash, neither in Debug mode, Release mode, forcing Suspend/Re-activation events etc..
When the Windows App Certification Kit runs my app the 6th (or the 7th) time, my splash screen shows briefly, then my app disappears (crashing, likely).
What is the WAPK doing in the 6th run, and how can I reproduce/debug this?
I’m not an expert, but i have just been through the same process with my application to see if I could work out what was going on. Below is write up of what I did (in the hope it is useful to someone else).
Certiication Kit results
FAILED: Crashes and hangs
Error Found: The crashes and hangs test detected the following errors:
Application neutral__6j94sra26jgtm was detected by Windows Error Reporting and experienced a crash or hang. Impact if not fixed: An app that stops responding or crashes can cause data loss and is a poor user experience. How to fix: Investigate, debug the executable(s) in question to identify and fix the problem, then rebuild and re-test the app. Using Application Verifier Within Your Software Development Lifecycle.
This did not help at all. I assume the link has been updated since this discussion, however I didnt think it was that useful.
Investigation
Some errors are logged in the Event Viewer (windows key + R, type in “eventvwr”). I can see three useful entries:
The Windows Error Reporting Event has a bit more information including some filepaths of where your it has saved its log file.
I ended up running the windows application certification tool from command line and isolated the test that was failing to the PerfromanceShutdown test. Command used to run from command prompt is:
This lead us towards something happening in the suspend / exit / resume methods.
The other place I looked was in
C:\Users\<userName>\AppData\Local\Microsoft\AppCertKit. This had a couple of large files (~100Mb) Windows Performance Analysis trace files. This looked useful, but I didnt understand it.Solution
Whilst I was looking at the trace files other people in the team found that the suspension manager was not closing the file references correctly.
This could be reproduced by using the DebugLocation toolbar in visual studio. Chooseing Suspend, Resume, Suspend and Terminate reproduced the problem.
Hope this helps someone as it seems to be a bit of a dark art debugging these errors.