12

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?

Ryan Gates
  • 4,501
  • 6
  • 50
  • 90
Ganesh R.
  • 4,337
  • 3
  • 30
  • 46
  • Did you check the Windows Event Log? It may include it in the event. – qJake Oct 18 '11 at 14:08
  • There are few useful links http://social.msdn.microsoft.com/Forums/en/clr/thread/060506fb-9bff-4085-82be-68220944f011 – sll Oct 18 '11 at 14:13

1 Answers1

7

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.

Ryan Gates
  • 4,501
  • 6
  • 50
  • 90
  • You don't have to specify it, there is a [default value](https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps): `%LOCALAPPDATA%\CrashDumps` – Ohad Schneider May 24 '21 at 19:24