Monday, July 23, 2012 4:38 PMIn WebForm/MVC applications you can use Application_Error to catch all unhandled/uncaught exceptions. What is the equivalent in VSTO?
- Moved by Cindy Meister MVPMVP, Moderator Tuesday, July 24, 2012 9:37 AM VSTO-specific (From:Word for Developers)
Wednesday, July 25, 2012 4:36 AMModerator
Thanks for posting in the MSDN Forum.
As far as I know, the Application_Error handler is created in an Global.asax file which is disable in vsto project. So I would suggest you use the Try/Catch to catch exception for VSTO.
Hope this can help you.
MSDN Community Support | Feedback to us
Wednesday, July 25, 2012 8:23 AM
how global erros are handled in web application and VSTO which is a client technology is coimpletly different thing. You must take care of following things:
1. in all VSTO raised events there should be try/catch clause to not let your exceptions escape - events like Addin Startup, Shutdown, and all others that you subscribe to using proper office API
2. if you will use background threads you can also use
System.Windows.Forms.Application.ThreadException and AppDomain.CurrentDomain.UnhandledException
Friday, July 27, 2012 3:22 PMThat is acceptable if that is the only option. If it is, it seems clanky and is not as elegant as the option is ASP.NET