Packaged WinUI app crashes on start-up when deployed to test PC #2407
Replies: 2 comments 4 replies
-
My issue was caused by trying to write files to What's odd is that on some Windows installation it works and on others it does not… <!-- That logs to something like: C:\Users\micro\AppData\Local\Packages\59798Slions.TaskbarPro_md9twrekhzh1t\LocalCache\Local\logs.txt -->
<target name="File" xsi:type="File" fileName="${specialfolder:folder=LocalApplicationData:cached=true}/logs.txt" /> Just make sure your packaged app does not try to write to files relative to your executable location. As to why the unhandled exception event is not called and why |
Beta Was this translation helpful? Give feedback.
-
Packaged apps are installed to a location that's very locked down (e.g.
|
Beta Was this translation helpful? Give feedback.
-
That app works great on both my development machines.
However it failed Windows Store submission because it crashed on start-up during certification.
Sure enough it crashes on start-up when installed on a third PC with something similar to that:
https://stackoverflow.com/questions/45200620/faulting-module-name-kernelbase-dll
Event logs reports:
Faulting module name: KERNELBASE.dll
I've added logs and registered to that
Application.UnhandledException
event however I'm not getting any logs meaning it looks like it crashes before the constructor of my Application class implementation.Is there an actual entry point I could use outside the Application class?
Updated to 1.1.0-preview1, same issue.
I've also determined that the application starts properly since some of my code is running. I can see the blank window with size and title bar text and icon set as expected but then it crashes badly later on and NLog does not even get a chance to write its logs somehow.
Even forcing flush with NLog target set to a file did not work. For some reason the log file is not created on the test PC even though it works fine on my development machine. Fortunately with NLog set to send logs over UDP using NLogViewer target I can get the logs using Sentinel.
Looks more and more like my issue has little to do with Windows App SDK after all. Still how comes I'm not getting unhandled exception event? Though the app works on that third PC when running from Visual Studio but still does not run when installed from an installer.
Related issues:
Beta Was this translation helpful? Give feedback.
All reactions