App crashes without any visible detailed Exception RRS feed

  • Question

  • Hi,

    seems like today is not my day :) I have an app which is randomly crashing and I am having serious problems finding the cause as I am not getting any exceptions at all. Not even in the output window. This is so frustrating because there is a lot of code and it's not very easy to nail down the cause of the crash (especially because it's kinda random..). 

    Can someone give me a hint how to get more information? Why do WP apps crash without any exceptions?

    I already turned off "Just my code" and there are a couple of "Cannot find or open the PDB file." messages and two "A first chance exception of type 'System.Exception' occurred in mscorlib.ni.dll" exceptions. But that's all happening way before the crash so it doesn't seem related.
    • Edited by Freddixx Monday, October 6, 2014 2:31 AM
    Monday, October 6, 2014 2:23 AM

All replies

  • Hi Freddixx,

    >>Can someone give me a hint how to get more information

    In my mind, it seems that there may has some unhandled exceptions in your app. Then I will recommand you handle them first. And we can detect such an exception by adding an event handler to Application.UnhandledException and write the exception details in the Debug.WriteLine method. Then the result will be visible in the Visual Studio Output / Debug window, for more information, please try to check the following code which comes form here:

    public App() { this.InitializeComponent(); .................. this.UnhandledException += App_UnhandledException; } void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) {

    StringBuilder sbTemp = new StringBuilder();

    if(e.Exception.StackTrace != null)
    sbTemp.Append("Stack Trace:");

    if(e.Exception.InnerException.Message != null)
    sbTemp.Append("Inner Exception:");

    string exceptionMsg = sbTemp.ToString();
    Debug.WriteLine(exceptionMsg); }

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 6, 2014 8:45 AM
  • Hi Amy, 

    thank you for your detailed answer. Unfortunately this did not help. There is no additional output.

    Any other suggestions?

    Monday, October 6, 2014 11:50 AM
  • Hi Freddixx, go to Debug Menu, Exceptions..., Mark all items under Common Language Runtime in order to stop the debugging in any exceptions.

    Try to fix or catch the exception.

    Hope it helps.


    Christian Amado
    Software Engineer | MCPD: Windows Phone Developer | MCTS: Silverlight Developer
    Don't forget to mark the right answer and vote up if helps you.
    MCP Profile

    Monday, October 6, 2014 6:56 PM
  • No, that didn't help either. I think this could be a bug in the geofencing API. I managed to narrow the issue down to a few lines of code and the method that creates the geofence is the only one that isn't atomic.
    Tuesday, October 7, 2014 6:21 PM
  • For bug, try post here: https://connect.microsoft.com
    Monday, October 20, 2014 5:01 AM