Environment.FailFast 메서드

정의

오류 메시지를 보고하기 전에 프로세스를 즉시 종료합니다. Windows의 경우 오류 메시지가 Windows 애플리케이션 이벤트 로그에 기록되고 메시지 및 선택적 예외 정보가 Microsoft에 대한 오류 보고에 포함됩니다. Unix와 유사한 시스템의 경우 스택 추적과 함께 메시지가 표준 오류 스트림에 기록됩니다.

오버로드

FailFast(String)

오류 메시지를 보고하기 전에 프로세스를 즉시 종료합니다. Windows의 경우 오류 메시지가 Windows 애플리케이션 이벤트 로그에 기록되고 메시지는 Microsoft에 대한 오류 보고에 포함됩니다. Unix와 유사한 시스템의 경우 스택 추적과 함께 메시지가 표준 오류 스트림에 기록됩니다.

FailFast(String, Exception)

오류 메시지를 보고하기 전에 프로세스를 즉시 종료합니다. Windows의 경우 오류 메시지가 Windows 애플리케이션 이벤트 로그에 기록되고 메시지 및 예외 정보가 Microsoft에 대한 오류 보고에 포함됩니다. Unix와 유사한 시스템의 경우 스택 추적과 함께 메시지가 표준 오류 스트림에 기록됩니다.

FailFast(String)

Source:
Environment.cs
Source:
Environment.cs
Source:
Environment.cs

오류 메시지를 보고하기 전에 프로세스를 즉시 종료합니다. Windows의 경우 오류 메시지가 Windows 애플리케이션 이벤트 로그에 기록되고 메시지는 Microsoft에 대한 오류 보고에 포함됩니다. Unix와 유사한 시스템의 경우 스택 추적과 함께 메시지가 표준 오류 스트림에 기록됩니다.

public:
 static void FailFast(System::String ^ message);
[System.Security.SecurityCritical]
public static void FailFast (string message);
public static void FailFast (string? message);
public static void FailFast (string message);
[<System.Security.SecurityCritical>]
static member FailFast : string -> unit
static member FailFast : string -> unit
Public Shared Sub FailFast (message As String)

매개 변수

message
String

프로세스가 종료된 이유를 설명하는 메시지이거나, 설명이 제공되지 않는 경우 null입니다.

특성

예제

다음 예제에서는 Windows에서 실행할 때 Windows 애플리케이션 이벤트 로그에 로그 항목을 쓰거나 Unix와 유사한 시스템에서 실행 중일 때 표준 오류 스트림에 오류 메시지를 쓰고 현재 프로세스를 종료합니다.

using System;

class Example
{
    public static void Main()
    {
       string causeOfFailure = "A catastrophic failure has occurred.";

       // Assume your application has failed catastrophically and must
       // terminate immediately. The try-finally block is not executed
       // and is included only to demonstrate that instructions within
       // try-catch blocks and finalizers are not performed.
       try
       {
           Environment.FailFast(causeOfFailure);
       }
       finally
       {
           Console.WriteLine("This finally block will not be executed.");
       }
   }
}
/*
The example produces no output because the application is terminated.
However, an entry is made in the Windows Application event log, and
the log entry contains the text from the causeOfFailure variable.
*/
open System

let causeOfFailure = "A catastrophic failure has occurred."

// Assume your application has failed catastrophically and must
// terminate immediately. The try-finally block is not executed
// and is included only to demonstrate that instructions within
// try-catch blocks and finalizers are not performed.
try
    Environment.FailFast causeOfFailure
finally
    printfn "This finally block will not be executed."

// The example produces no output because the application is terminated.
// However, an entry is made in the Windows Application event log, and
// the log entry contains the text from the causeOfFailure variable.
Module Example
    Public Sub Main()
        Dim causeOfFailure As String = "A catastrophic failure has occurred."
        ' Assume your application has failed catastrophically and must
        ' terminate immediately. The try-finally block is not executed 
        ' and is included only to demonstrate that instructions within 
        ' try-catch blocks and finalizers are not performed.

        Try
            Environment.FailFast(causeOfFailure)
        Finally
            Console.WriteLine("This finally block will not be executed.")
        End Try
    End Sub
End Module
'
' The code example displays no output because the application is
' terminated. However, an entry is made in the Windows Application event
' log, and the log entry contains the text from the causeOfFailure variable.

설명

이 메서드는 활성 try/finally 블록 또는 종료자를 실행하지 않고 프로세스를 종료합니다.

Windows에서 메서드는 Environment.FailFast 문자열을 message Windows 애플리케이션 이벤트 로그에 쓰고, 애플리케이션의 덤프를 만든 다음, 현재 프로세스를 종료합니다. 문자열은 message Windows 오류 보고 통해 Microsoft에 오류 보고에도 포함됩니다. 자세한 내용은 Windows 오류 보고: 시작 참조하세요.

Unix와 유사한 시스템에서 메시지는 스택 추적 정보와 함께 표준 오류 스트림에 기록됩니다.

사용 하 여 합니다 Environment.FailFast 메서드 대신 합니다 Exit 애플리케이션의 상태는 복구할 수 없을 정도로 손상 된 경우 애플리케이션을 종료 하는 방법 및 애플리케이션의 실행 try/finally 블록 및 종료자 프로그램 리소스를 손상 됩니다.

메서드를 Environment.FailFast 호출하여 Visual Studio 디버거에서 실행되는 애플리케이션의 실행을 종료하면 가 throw ExecutionEngineException 되고 fatalExecutionEngineError MDA(관리 디버깅 도우미)가 자동으로 트리거됩니다.

적용 대상

FailFast(String, Exception)

Source:
Environment.cs
Source:
Environment.cs
Source:
Environment.cs

오류 메시지를 보고하기 전에 프로세스를 즉시 종료합니다. Windows의 경우 오류 메시지가 Windows 애플리케이션 이벤트 로그에 기록되고 메시지 및 예외 정보가 Microsoft에 대한 오류 보고에 포함됩니다. Unix와 유사한 시스템의 경우 스택 추적과 함께 메시지가 표준 오류 스트림에 기록됩니다.

public:
 static void FailFast(System::String ^ message, Exception ^ exception);
[System.Security.SecurityCritical]
public static void FailFast (string message, Exception exception);
public static void FailFast (string? message, Exception? exception);
public static void FailFast (string message, Exception exception);
[<System.Security.SecurityCritical>]
static member FailFast : string * Exception -> unit
static member FailFast : string * Exception -> unit
Public Shared Sub FailFast (message As String, exception As Exception)

매개 변수

message
String

프로세스가 종료된 이유를 설명하는 메시지이거나, 설명이 제공되지 않는 경우 null입니다.

exception
Exception

종료의 원인이 된 오류를 나타내는 예외입니다. 일반적으로 catch 블록의 예외입니다.

특성

설명

이 메서드는 활성 try/finally 블록 또는 종료자를 실행하지 않고 프로세스를 종료합니다.

Windows에서 메서드는 Environment.FailFast 문자열을 message Windows 애플리케이션 이벤트 로그에 쓰고, 애플리케이션의 덤프를 만든 다음, 현재 프로세스를 종료합니다.

정보는 Windows 오류 보고 사용하여 Microsoft에 보고됩니다. 자세한 내용은 Windows 오류 보고: 시작 참조하세요. Microsoft에 대한 오류 보고에는 오류를 분류하는 데 사용되는 세부 정보를 제공하는 및 exception 정보가 포함됩니다message. 프로세스가 종료되어 처리되지는 않지만 exception 예외를 발생시킨 컨텍스트 정보는 여전히 가져옵니다.

Unix와 유사한 시스템에서 메시지는 스택 추적 정보와 함께 표준 오류 스트림에 기록됩니다.

null이거나 가 throw되지 않은 경우 exceptionexception 이 메서드는 메서드 오버로드와 FailFast(String) 동일하게 작동합니다.

사용 하 여 합니다 Environment.FailFast 메서드 대신 합니다 Exit 애플리케이션의 상태는 복구할 수 없을 정도로 손상 된 경우 애플리케이션을 종료 하는 방법 및 애플리케이션의 실행 try/finally 블록 및 종료자 프로그램 리소스를 손상 됩니다.

메서드를 Environment.FailFast 호출하여 Visual Studio 디버거에서 실행되는 애플리케이션의 실행을 종료하면 가 throw ExecutionEngineException 되고 fatalExecutionEngineError MDA(관리 디버깅 도우미)가 자동으로 트리거됩니다.

적용 대상