Immediately terminates a process after writing a message to the Windows Application event log : Environment Settings « Development Class « C# / C Sharp
Immediately terminates a process after writing a message to the Windows Application event log
using System;
class Sample
{ public static void Main()
{
string causeOfFailure = "this is a test."; try
{
Environment.FailFast(causeOfFailure);
} finally
{
Console.WriteLine("This finally block will not be executed.");
}
}
}