Export (0) Print
Expand All

Environment::FailFast Method (String)

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

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public:
static void FailFast(
	String^ message
)

Parameters

message
Type: System::String
A message that explains why the process was terminated, or nullptr if no explanation is provided.

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

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.

Use the FailFast method instead of the Exit 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.

The following example writes a log entry to the Windows Application event log and terminates the current process.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft