- Follow the instructions here to enable WER. Make sure the
DumpType
is set to 2 (Full Dumps). - Make a new Module (static Class in C#) called
ProgramEntryPoint
. - Copy the code written below and don't forget to change
YOUR_STARTUP_FORM_NAME_HERE
. - Change project configuration to Debug
- Go to Project Properties. In the Application tab, uncheck "Enable application framework".
- Change Startup Object to
Sub Main
. - Go to Debug -> Windows -> Exception Settings and make sure Common Language Runtime Exceptions is checked (full checked and not partially checked).
- Now whenever an unhandled exception occurs, your application will quit and a
.dmp
file will be created in the folder specified in theDumpFolder
registry key. - Open the
.dmp
file in Visual Studio - Click on "Set symbol paths". Make sure Microsoft Symbol Servers is enabled and add the path to your PDB files as well.
- Click on Debug with Mixed. If you've followed all the instructions, it should take you right to the line in the source code where the exception occurs with all variables and stack trace intact.
Last active
May 6, 2024 06:37
-
-
Save PyroGenesis/05bd414d580ef662a4d50120ea9643f4 to your computer and use it in GitHub Desktop.
Instructions for dumping stack information of Winforms application using WER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Module ProgramEntryPoint | |
<STAThread()> | |
Sub Main(args As String()) | |
Application.EnableVisualStyles() | |
Application.SetCompatibleTextRenderingDefault(False) | |
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException) | |
Application.Run(New YOUR_STARTUP_FORM_NAME_HERE) | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment