You may have to work with App_DispatcherUnhandledException. I was
just reading about it today, I haven't used it yet.
Take a look at
http://msdn2.microsoft.com/en-us/library/ms743714.aspx
for an example of how it's implemented. It's about half way down the
page.
You can also go here for more info:
http://msdn2.microsoft.com/en-us/lib...exception.aspx
On Aug 15, 8:46 am, Horst Klein <HorstKl...@discussions.microsoft.com>
wrote:
> I my Forms Application I catch unhandled Exceptions this way and show them
> in a custom ErrorDialog:
>
> Public Shared Sub Main()
> AddHandler System.Windows.Forms.Application.ThreadException, AddressOf
> OnVitoThreadError
> AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf
> OnVitoUnhandledError
>
> Try
> m_Application = New MyCustomApplication
> m_Application.Run()
> Catch ex As Exception
> ErrorDialog.ShowError(ex)
> End Try
> End Sub
>
> Private Shared Sub OnVitoUnhandledError(ByVal sender As Object, ByVal e As
> UnhandledExceptionEventArgs)
> MyErrorDialog.ShowError(ex)
> If e.IsTerminating Then Environment.Exit(-1)
> End Sub
>
> Private Shared Sub OnVitoThreadError(ByVal sender As Object, ByVal e As
> System.Threading.ThreadExceptionEventArgs)
> LogFacade.LogCriticalError("Nicht behandelter Fehler ThreadException",
> e.Exception)
> MyErrorDialog.ShowError(e.Exception)
> End Sub
>
> If I do the same Sub Main in a WPF Project my Error never will shown.
> What kind of Event I have to handle?