Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the application dump created by Environment.FailFast() located on the disk?

Tags:

c#

.net

event-log

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?

like image 803
Ganesh R. Avatar asked Oct 18 '11 14:10

Ganesh R.


People also ask

How do I get a crash dump in Windows 10?

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.

What is an app dump?

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.


1 Answers

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:

enter image description here

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.

like image 135
Ryan Gates Avatar answered Sep 22 '22 05:09

Ryan Gates