10
WPF 응용 프로그램에서 처리되지 않은 예외를 처리하는 가장 좋은 방법은 무엇입니까?처리되지 않은 예외
WPF 응용 프로그램에서 처리되지 않은 예외를 처리하는 가장 좋은 방법은 무엇입니까?처리되지 않은 예외
당신은 사용할 수 있습니다 DispatcherUnhandledException
:
XAML (App.xaml) : 코드 뒤에 (App.xaml.cs를/VB
<Application x:Class="App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="wndMain.xaml" DispatcherUnhandledException="Application_DispatcherUnhandledException">
:.
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
// Handle error here
...
// Prevent default unhandled exception processing by WPF
e.Handled = true;
}
이 more here 최대 읽기 항상 그러나 처음부터 정확한 양의 오류 처리를 수행하십시오.이 방법으로 오류를 전달하지 마십시오.