솔루션 탐색기에서 "내 프로젝트"를 두 번 클릭 해보십시오.
"응용 프로그램"탭에서 아래쪽으로 "응용 프로그램 이벤트보기"단추가 있습니다. 클릭하세요.
"ApplicationEvents"파일이 표시되어야합니다. UnhandledException
이벤트를 선택하십시오.
은 다음과 같아야합니다
Namespace My
' The following events are available for MyApplication:
'
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication
Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
// log your exception here.
End Sub
End Class
End Namespace
참고 :이 이벤트는 while a debugger is attached을 발생하지 않습니다.
훌륭한 응답과 예를 보내 주셔서 감사합니다. 이것은 내가 찾고 있었던 바로 그 것이다! –