I have a Windows pone application that works quite well, unless it returns from Tombstonning and then quits rather randomly after executing the same command several times.
I set VS2012 to pause on any exception for the first chance, but nothing happens:

I also have handlers for the following events:
this.application.UnhandledException += this.OnApplicationUnhandledException; this.application.RootFrame.NavigationFailed += this.OnRootFrameNavigationFailed; AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
None of the handlers are called: S
The only information I have is the next line in the output, which means nothing to me. Any help would be really good, thanks.
The program '[1040] TaskHost.exe' has exited with code -2147483645 (0x80000003).
EDIT: Finally, I tracked the problem down to the following line:
Contract.Requires<ArgumentNullException>(bitmap != null, "Bitmap cannot be null.");
The application exits even if the bitmap variable is not equal to zero. Any idea?
source share