Environment.FailFast メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Environment.FailFast メソッドの意味・解説 

Environment.FailFast メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

アクティブな try-finally ブロックまたはファイナライザ実行せずに、プロセス終了します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説
使用例使用例

ログ エントリを Windows アプリケーションイベント ログ書き込み現在のプロセス終了させるコード例次に示します

' This code example demonstrates the Environment.FailFast() 
' method.

Imports System

Class Sample
    Public Shared Sub Main()
 
        Dim causeOfFailure As String
 = "A castrophic failure has occured."
        
        ' 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 'Main
End Class 'Sample

'
'This code example produces the following results:
'
'(No output is produced 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.)
'
// This code example demonstrates the Environment.FailFast() 
// method.

using System;

class Sample 
{
    public static void Main()
 
    {
    string causeOfFailure = "A castrophic failure has occured.";

// 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.");
        }
    }
}

/*
This code example produces the following results:

(No output is produced 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.)

*/
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からEnvironment.FailFast メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からEnvironment.FailFast メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からEnvironment.FailFast メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Environment.FailFast メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Environment.FailFast メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS