I have a UsersController, with OnException (which works), but if I make the Controller inherit from BaseController, the OnException doesn’t work, even if I put it in the BaseController.
Basically I want to have all my controllers inherit from BaseController so I can just have one OnException handler there, which catches everything…
You don’t need to inherit from a custom base controller class in order to have all controllers handle exceptions the same way. You can do it with an ActionFilter.
You can apply this to all of the controllers in your library with this Global.asax: