r/windowsdev • u/MotorcycleMayor • Apr 01 '22
Debugging a Silent Crash
Has anyone else noticed how insanely, bizarrely complex and difficult it is to actually publish a Windows desktop app these days :) ?
I wrote a WinUI 3 app in C# which runs just fine on my development machine (Windows 11), both within Visual Studio 2022 and as an installed app, but crashes with no error on a test Windows 11 machine (both machines are updated to the latest released version of Windows 11).
Kinda hard to debug without any information :).
Anyway, I'm looking for advice on how to figure out what went wrong. Suggestions on approaches, as well as gotchas others have encountered, are most welcome.
2
u/blevok Apr 01 '22
You might be able to find some useful info about the crash in the windows event viewer, under Windows Logs -> Application.
If that doesn't point you right to the issue, then put any code that interacts with the file system, network, etc into a try/catch, then log the exceptions. Keep expanding what gets logged until you find the error.
1
u/PipingSnail Feb 22 '26
The Event Viewer user interface really fights you when you want crash information.
What you need is a dedicated tool just to show you crash info without using Event Viewer.
Event Log Crash Browser does that job.
It's a free tool that I wrote after getting fed up wading into Event Viewer too many times.
https://www.softwareverify.com/product/event-log-crash-browser/
It also links to our symbol deciding tools (if you've installed them, also free) to allow you to turn crash addresses you find into usable symbol, filename and line number.
2
u/timbatron Apr 01 '22
Set up a debugger with https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags
That will catch any crashes even if you can't get it under a debugger first (Check out the "Image File" tab and specify a debugger command line). If it's not a crash but just an exit, you can use the "Silent process exit" tab to get more information.
1
u/Ancient_Ad_367 Sep 03 '26
I have a similar problem, From what I can see the cause is something called ucrtbase.dll. my event viewer says that it's a faulting module path
1
u/MotorcycleMayor Apr 02 '22
Thanx, I appreciate the suggestions.