System.Environment.FailFast Method

Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message in error reporting to Microsoft.

Syntax

public static void FailFast (string message)

Parameters

message
A message that explains why the process was terminated, or null if no explanation is provided.

Remarks

This method terminates a process without running any active try/finally blocks or finalizers.

The Environment.FailFast(string) 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.

Use the Environment.FailFast(string) method instead of the Environment.Exit(int) method to terminate your application if the state of your application is damaged beyond repair, and executing your application's try/finally blocks and finalizers will corrupt program resources.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0