Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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:
[SecurityCriticalAttribute]
static void FailFast(
	String^ message
)

Parameters

message
Type: System::String^

A message that explains why the process was terminated, or null 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.

Information is reported to Microsoft by using Windows Error Reporting. For more information, see Windows Error Reporting: Getting Started.

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.

SecurityCriticalAttribute

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

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft