[App.xaml.cs]
public partial class App : Application
{
public App()
{
AppDomain.CurrentDomain.FirstChanceException += FirstChanceException;
}
private void FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message);
}
}
무슨 에러가 됐든지간에 에러가 발생하면 해당 코드로 먼저 들어온다.
'SW개발 > c#' 카테고리의 다른 글
[WPF] Messenger 구현 (MVVM) (0) | 2023.02.17 |
---|---|
[WPF]WndProc - 윈도우메시지 처리 적용 (0) | 2023.02.14 |
[C#] Logger (0) | 2023.01.31 |
[WPF] LED Light UI 코드 (2) | 2023.01.31 |
[C#]DataTable To List (0) | 2023.01.26 |