How catch unhandle exception in outlook addin?
-
Wednesday, October 21, 2009 5:42 AMhi all
I have added AppDomain.CurrentDomain.UnhandledException event ,but it can't catch the unhande exception.
so how to catch the unhande exception in add-in ?
thanks
Daniel
All Replies
-
Wednesday, October 21, 2009 7:41 AM
My addin is a wpf control, and host at elementHost.
Daniel -
Thursday, October 22, 2009 7:46 AMModerator
Hello Daniel,
For unhandled exception, this issue has been discussed in this forum many times. Search this forum with key string "unhandled exception", and you will see a couple of threads. In general, you will get this answer form this thread: Catching Unhandled Exceptions and this link.
Useful link:
UnhandledExceptionEventHandler Delegate.
AppDomain.UnhandledException Event.
You could use try/catch block to catch this exception.
Best regards,
Bessie
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer by Bessie ZhaoModerator Wednesday, October 28, 2009 2:06 AM
-
Friday, November 12, 2010 6:01 PMThis is correct in most cases, however, if the Outlook Add-In is a VSTO Add-In, then you need to implement the above to catch unhandled exceptions that come from any dialogs you may have however, MOST unhandled exception will be caught by the VSTO "shim". I don't know of a way to catch those before VSTO does, except to catch the exception as close to the point of origination as possible, at which point it no longer becomes an unhandled exception :)
-mc

