I am trying to use Environment.FailFast() in my application. The MSDN documentation says that it creates an application dump during application termination.
The FailFast method writes the message string to the Windows Application event log, creates a dump of your application, and then terminates the current process. The message string is also included in error reporting to Microsoft.
Can someone direct me to the location where the dump is created?
In Control Panel, select System and Security > System. Select Advanced system settings, and then select the Advanced tab. In the Startup and Recovery area, select Settings. Make sure that Kernel memory dump or Complete memory dump is selected under Writing Debugging Information.
A dump is a file that contains a snapshot of the process at the time it was created and can be useful for examining the state of your application. Dumps can be used to debug your . NET application when it is difficult to attach a debugger to it such as production or CI environments.
I used the following code to reproduce the issue:
Environment.FailFast("Something bad happened");
You need to add the correct registry entries for it to place the dump in your desired location or you can read it to find the location. Here is the registry key:
which is
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
You can read more about other options in Getting full user mode dumps automatically when your process crashes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With