I have an app that works ok on the device emulator but on the real device it crashes after some time. It can happen after some minutes as well after 1-2 hours. The problem happens both with the device alone or attached to visual studio.
The point is that no exception is being thrown, VS just reports the connection was lost. I did check if i'm using too much memory but that's not the case (http://stackoverflow.com/questions/4239193/whats-causing-my-wp7-app-to-crash).
What can cause apps to crash without throwing exceptions?
It can crash without a visible exception on a Stackoverflow.
While debugging, you can detect such an exception by adding an event handler to Application.UnhandledException
and writing the exception details in the Debug.WriteLine
method. The result is visible in the Visual Studio Output / Debug window.
private void OnAppUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
Debug.WriteLine(e.ExceptionObject.ToString());
}
You could get a crash that isn't caught if it happens on a non-UI thread. Check your async calls.
Also, any error in code that is executed in response to an action on an application bar button item or menu item could have cause this behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With