locked
How to determine why my app is crashing without exceptions being thrown? RRS feed

  • Question

  • Hello!

    I currently am working on an app that crashes in the middle of attempting In App Purchasing. However, it does not seem like any exception is thrown. I thought listening to the App's UnhandledException event would let me capture it, but it does not seem to run.

    • This crashes about 5 seconds into running RequestProductPurchaseAsync(sku).
    • It does not crash if the debugger is attached. (This confuses me.)
    • The log before RequestProductPurchaseAsync(sku) is displayed and written to disk.
    • I never see the log in OnUnhandledException.

    await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
        {
            try {
                if (IsSimulation) {
                    purchaseResult = await CurrentAppSimulator.RequestProductPurchaseAsync(sku);
                }
                else {
                    Debug.Log("PurchaseProductAsync is attempting REAL PURCHASE NOW!");
                    // Crash ~5 seconds into this call. No exception is thrown.
                    purchaseResult = await CurrentApp.RequestProductPurchaseAsync(sku);
                    //  This does not display.
                    Debug.Log("PurchaseProductAsync got result " + (purchaseResult == null ? "null" : purchaseResult.Status.ToString()));
                }
            }
            catch (Exception purchaseExc) {
                purchaseResult = null;
                result.ErrorCode = "-285";
                result.ErrorException = purchaseExc;
                result.ErrorMessage = "Exceptional Error";
                Debug.Log("PurchaseProductAsync got an exception when attempting to purchase from CurrentApp or CurrentAppSimulator. " + purchaseExc.GetType() + ": " + purchaseExc.Message);
            }
        });

    This code in my App.xaml.cs script never seems to run either.

    public App()
    {
        this.InitializeComponent();
        appCallbacks = new AppCallbacks();
        UnhandledException += OnUnhandledException;
    }
    
    private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        // Never seems to run
        Debug.Log("Received unhandled exception");
    }

    What else can I try to gather data on why my app is crashing?


    Garth Smith. Games. Math. Code.





    Friday, March 4, 2016 11:19 PM

Answers

  • Hi

    Try disable Just My Code debugger option maybe after you can seen  your Debug.Log("Recived  unhandled exception")

    Debug->Options and Settings -> General   and unpin the value of  Enable Just My Code.


    • Proposed as answer by Barry Wang Thursday, March 17, 2016 7:37 AM
    • Marked as answer by Barry Wang Wednesday, March 30, 2016 8:47 AM
    Saturday, March 5, 2016 5:22 PM

All replies

  • Hi

    Try disable Just My Code debugger option maybe after you can seen  your Debug.Log("Recived  unhandled exception")

    Debug->Options and Settings -> General   and unpin the value of  Enable Just My Code.


    • Proposed as answer by Barry Wang Thursday, March 17, 2016 7:37 AM
    • Marked as answer by Barry Wang Wednesday, March 30, 2016 8:47 AM
    Saturday, March 5, 2016 5:22 PM
  • @Garth Smith,

    Have you created the WindowsStoreProxy.xml yourself to test? RequestProductPurchaseAsync in my mind it related to xml file cannot find or permission problem. Maybe you can manually create the xml file and use ReloadSimulatorAsync to see if will work.

    By the way, can you see any info from system event viewer?

    Best regards,

    Barry


    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, March 7, 2016 6:24 AM