Friday, May 11, 2012 1:28 PM
Is there a list of conditions under which an application will get shut down by the OS?
This is working fine when invoked from the command line or from within Visual Studio. But when run from Jenkins, our CI system, the application gets interrupted while running the tests. The exit code for the process spawned via IApplicationActivationManager is 0.
Manually bringing the app to the foreground doesn't help. My guess is that maybe Windows includes the memory footprint of the spawning process against some limit, finds the Java Runtime and decides it's a greedy app that needs to be shut down.
When configuring the app to run (any combination of) fewer tests so that it takes less time, everything works great so I'm thinking there may be a timer involved.
Hoping for hints and suggestions
Friday, May 11, 2012 2:11 PMUpdate: I just found that my earlier assumption is totally bogus because the WWAHost spawned via IApplicationActivationManager isn't a child process of the application that activates the application. So I'm even more baffled as to the circumstances of the application exiting prematurely when run via CI.
Friday, May 11, 2012 8:02 PMModerator
Your app should only be active when it is in the foreground (the OS enforces this).
If you app is suspended (not in the foreground) and the OS determines there is memory pressure, it can transition the app from suspended to terminated.
See this for the complete picture:
Jeff Sanders (MSFT)
Saturday, May 12, 2012 2:46 AMModerator
Your test harness can use the IPackageDebugSettings interface to put the app into a debug mode and disable suspend. This is how the Visual Studio debugger can let you switch between the app and VS without the app suspending.
- Marked As Answer by Jeff SandersMicrosoft Employee, Moderator Monday, May 14, 2012 12:36 PM
Monday, May 14, 2012 8:22 AM
who implements this IPackageDebugSettings interface? IApplicationActivationManager?
Monday, May 14, 2012 9:40 AMModerator
It's implemented by the CLSID_PackageDebugSettings object.
There is a non-Microsoft project at http://winrt.codeplex.com you can take a look at for an example of implementing this. It may still not be updated for the Consumer Preview, but it should give general overview of what you can do with this interface.
- Edited by Rob CaplanMicrosoft Employee, Moderator Thursday, May 17, 2012 12:02 AM fixed link
Monday, May 14, 2012 9:45 AMRob, there is no winrtdebug.codeplex.com project, its http://winrt.codeplex.com/