question

MarcelDelhaye-5524 avatar image
1 Vote"
MarcelDelhaye-5524 asked ·

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

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.

uwp
· 4
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you alter the configuration when debugging with Visual Studio in Release mode? Perhaps you want to look at this site for debugging recommendations in Release, so you can follow what your app is doing:

https://devblogs.microsoft.com/devops/debugging-net-native-windows-universal-apps/

0 Votes 0 · ·

I applied the instructions given by the link, but when I run debugging, here is what I get:

A first Window :
A debugger is attached to MyProjects.exe but is not configured to debug this unhandled exception. To debug this exception, detach the active debugger.

I click on OK button and after, I have a second window :
A win32 exception has occurred in MyProjects.exe
Debuggers available :
New instance of Visual Studio Community 2017

Set the selected debugger as the default debugger -> is checked
Manually choose debugging engines -> is not checked

Thank you for telling me what to do

0 Votes 0 · ·

Have you tried to use App Center to see if it could get some useful messages? Generally speaking, if your app runs into an error, the Event Viewer should log the error message. Could you please give a simple description of what the app should do when it is launched? Like you are querying for data from a server or some other works?

0 Votes 0 · ·

I don't think App Center can help him 'cause App Center only generates reports for apps that are on the Store. If his app isn't on the store, which is true for most of us, that won't work.

0 Votes 0 · ·
MarcelDelhaye-5524 avatar image
0 Votes"
MarcelDelhaye-5524 answered ·

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


· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Glad to hear that my teammate had solved your problem. Could you please accept your reply as answer so that others who are facing the same problem could see that?

0 Votes 0 · ·
MarcelDelhaye-5524 avatar image
0 Votes"
MarcelDelhaye-5524 answered ·

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 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you please tell me about what the app is doing when it is launched? Like you are querying for data from a server or doing some other works?

0 Votes 0 · ·

After talking with other engineers, I'm told that there is a known issue for Visual Studio 2017 that it might cause a problem with the manifest file. So I'd suggest you move to Visual Studio 2019 and keep it in the latest version. This issue is fixed in Visual Studio 2019. Hope this could help you!

0 Votes 0 · ·