I am trying to attach a unhandled exception handler for .NET excel addin. The problem is the exception handler is never called.
AppDomain.CurrentDomain.UnhandledException doesn't work - never fires the event.
Application.Current.DispatcherUnhandledException can't be used as Application is null in the excel addin code.
how do you wire an unhandled exception handler then?
An unhandled exception is an error in a computer program or application when the code has no appropriate handling exceptions.
To handle exceptions and display user friendly messages, we need to install Microsoft. AspNetCore. Diagnostics NuGet package and add middleware in the Configure() method. If you are using Visual Studio templates to create ASP.NET Core application then this package might be already installed.
View Unhandled Exceptions in Windows Event Viewer If your application has unhandled exceptions, that may be logged in the Windows Event Viewer under the category of “Application”. This can be helpful if you can't figure out why your application suddenly crashes.
You might not be able to, since the application is actually an unmanaged application. You might have to just put try/catch blocks around flaky areas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With