2

I am creating a WPF Office add in, and I would like to handle all exceptions in one place. To do this I use the following code in the constructor of my MainWindowViewModel:

Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += new 
     DispatcherUnhandledExceptionFilterEventHandler(HandleAllException);

In my test environment I host the WPF app from a console application project, and exceptions are handled as expected. When I host the WPF app from within word however, nothing happens when exceptions are thrown. There is no notification at all that there has even been an exception, other than in the output window in visual studio. Does anyone have any suggestions as to what I might be doing wrong?

4

1 回答 1

1

I have solved the problem by changing the way in which I launch my WPF app. I believe the problem was related to this.

于 2012-10-15T12:05:32.223 回答