Unexpected windows phone application exit without any exception

4

I have a windows pone application working quite well except when it comes back from Tombstonning, then quite randomly it silently exits after executing the same command some times.

I have set VS2012 to pause on any first chance exception but nothing happens:

enter image description here

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 gets called :S

The only information I have is the following line on the output which does not mean anything to me. Any help would be really good, thanks.

The program '[1040] TaskHost.exe' has exited with code -2147483645 (0x80000003).

EDIT: Finally I tracked down the problem to the following line:

Contract.Requires<ArgumentNullException>(bitmap != null, "Bitmap cannot be null.");

The application is exiting even when the bitmap variable is not null. Any idea?

.net
silverlight
windows-phone-7
exception
windows-phone-8
asked on Stack Overflow Jun 16, 2013 by Ignacio Soler Garcia • edited Jun 25, 2013 by Ignacio Soler Garcia

2 Answers

2

Seems that this is a defect on the CodeContracts API.

Calling:

Contract.Requires<ArgumentNullException>(bitmap != null, "Bitmap cannot be null.");

makes the application exit sometimes (event with bitmap not null) with the only information being:

The program '[1040] TaskHost.exe' has exited with code -2147483645 (0x80000003).

1

Interestingly enough it is not the only case when unexpected exit happens. In my case it is related to a combination of WebBrowser control, Microsoft AdControl and UploadOperation/DownloadOperation. If I take at least one of those things out of the equation the application becomes rather stable but with all of them in the application at once it can unexpectedly exit practically at any time: when you scroll WebBrowser control content, when you pause or resume DownloadOperation, when AdControl content is refreshed at the same time something is changed on the screen. In my case the error code is 1. I wonder how to approach investigation of such problem to find more or less exact cause and try to minimize the probability of the exiting. I definitely cannot completely remove WebBrowser control or AdControl or DownloadOperation/UploadOperation but potentially I could "realign" something so to speak but what and where?

answered on Stack Overflow Oct 5, 2014 by alex.49.98

User contributions licensed under CC BY-SA 3.0