Visual studio 2017: Debugging a UWP app works in debug mode, but not in release mode

Marcel Delhaye 26 Reputation points
2019-11-15T18:16:50.867+00:00

Hello,
I am developing a UWP application with Visual Studio 2017. When I run this application in Debug - x86 mode, it runs correctly from VS, and also from the start menu. On the other hand, when I run it in Release - x86 mode, sometimes it runs, sometimes Visual Studio tells me that it is in Stop mode, sometimes the SplashScreen appears, then everything freeze. And from the start menu, SplachScreen appears, stays on for a few seconds, then closes.
When debugging in Release - x86 mode completes correctly, I can generate a package (which I have been able to upload to the store), but the certification kit crashes when launching the platform version. I am forced to do an End of Task on the process to stop it.
Thank you for helping me, because I do not see where the problem is, and I cannot publish my application on the Store.

Remark ;
I checked the event / application log after running in release mode, and there is no error corresponding to my application. When the compilation is finished, the SplashSceen appears, and then the application is running correctly.
However, when running the application from the Start menu, I get an error message:

The program MesProjets.exe version 1.0.0.0 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance Control Panel.
Process ID: 3160
Start time: 01d59bdb85c2e1ab
Stop time: 4294967295
Application path: F: \ Users \ xxxxxxxx \ Documents \ Visual Studio 2017 \ Projects \ MyProjects \ MyProjects \ bin \ x86 \ Release \ AppX \ MyProjects.exe
Report ID: 343bcd14-47f6-4070-8426-77c5e0eea241
Failed Package Full Name: 503ApriSoft.MesProjets_4.0.0.0_x86__p639jsfcetr2j
Application ID for a faulty package: App
Blocking type: Cross-thread

Name of the event log : Application
Source : Application Hang
Date : 15/11/2019 18:39:47
Event ID : 1002
Category of the task : (101)
Level : Error
Keywords: Classic
User : N/A
Computer : PC-WIN10

Note : there is nothing about the application in the Security and Maintenance Control Panel.

Universal Windows Platform (UWP)
{count} vote

2 answers

Sort by: Most helpful
  1. Marcel Delhaye 26 Reputation points
    2019-11-19T10:51:47.64+00:00

    Hello Muzib, that's exactly right. My app is on the store, but in an older version for WP8.1
    The version that crash is not on the store, so no return on the crash in the App Center!
    On the other hand, the app log indicates this when the crash app:

    The program MesProjets.exe version 1.0.0.0 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance Control Panel.
    Process ID: 3160
    Start time: 01d59bdb85c2e1ab
    Stop time: 4294967295
    Application path: F: \ Users \ marceldelhaye \ Documents \ Visual Studio 2017 \ Projects \ MyProjects \ MyProjects \ bin \ x86 \ Release \ AppX \ MyProjects.exe
    Report ID: 343bcd14-47f6-4070-8426-77c5e0eea241
    Failed Package Full Name: 503ApriSoft.MesProjets_4.0.0.0_x86__p639jsfcetr2j
    Application ID for a faulty package: App
    Blocking type: Cross-thread

    Name of the event log : Application
    Source : Application Hang
    Date : 15/11/2019 18:39:47
    Event ID : 1002
    Category of the task : (101)
    Level : Error
    Keywords: Classic
    User : N/A
    Computer : PC-WIN10

    Note : there is nothing about the application in the Security and Maintenance Control Panel.

    Thank you for telling me if I can deduce the cause of the crash of the app.


  2. Marcel Delhaye 26 Reputation points
    2019-11-20T19:25:22.827+00:00

    Hello, Another programmer from Microsoft gave me the solution: the problem does not come from VS 2017, but from the creation of the SQLite database: we have to wait for it to be created before accessing it. The solution is here: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/4d3abc1e-e240-47d2-89b6-46500037b316/visual-studio-2017-debugging-a-uwp-app-works-in-debug-mode-but-not-in-release-mode?forum=wpdevelop

    Best regards Marcel


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.