Global exception dispatcher in word addin RRS feed

  • Question

  • Hello,
    I write an Word Addin with VS 2013 with c# and WPF windows hosted by Winform (required).
    I would like to use an global handled exception but I don't find the solution. I try, in Startup methos in addin : 

    Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += Dispatcher_UnhandledExceptionFilter);
    Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;

    and I add this methods with breakpoints : 

            void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
                // Display error message or close the window.
            void Dispatcher_UnhandledExceptionFilter(object sender, DispatcherUnhandledExceptionFilterEventArgs e)
                e.RequestCatch = false;
                // Display error message or close the window.

    But the execution don't proceed my dispatchers. 
    Have an idea ? It's very important to have a global exception dispatcher.
    Thnk you in advance.

    Wednesday, July 27, 2016 9:48 AM