Application_Error not triggering in asp.net web api

How can I get Application_Error in an ASP.NET WebAPI application? The error that I encountered now is that when the controller is resolved through NInject and crashes, it does not fall into Application_Error , and we cannot register the error, since we are doing a global log in Application_Error .

We also have a global filter for error handling, but this only works if we find the controller, but since we are not creating an instance of the controller, we will not go through any filters.

So, how do I catch an Exception caused by trying to create a controller that processes the response?

+6
source share

Source: https://habr.com/ru/post/946663/


All Articles