Global exception dispatcher in addin word 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 method 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.

    • Edited by Christophee Wednesday, July 27, 2016 12:32 PM
    Wednesday, July 27, 2016 12:31 PM


All replies