
説明/参照:
Explanation:
注:ハンドラのインラインラムダ式を使用したコード例:
クラスの例
{
static void Main()
{
AppDomain.CurrentDomain.FirstChanceException +
(オブジェクトソース、FirstChanceExceptionEventArgs e)=>
{
Console.WriteLine( "{0}で発生したFirstChanceExceptionイベント:{1}"、
AppDomain.CurrentDomain.FriendlyName、e.Exception.Message);
};
ハンドラを別途定義した例
static void FirstChanceHandler(オブジェクトソース、FirstChanceExceptionEventArgs e)
{
Console.WriteLine( "{0}で発生したFirstChanceExceptionイベント:{1}"、
AppDomain.CurrentDomain.FriendlyName、e.Exception.Message);
}
リファレンス:https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-receive-first-chance-例外通知