The ErrorHandlingControllerFactory
from ELMAH returns a custom action invoker which it uses to make sure its HandleErrorWithElmahAttribute
is applied to the controller. It never supplies an async action invoker so it doesn't understand async/await.
Two workarounds;
- Try upgrading to the latest ELMAH - it may have fixes for async/await.
- Remove the call to
ControllerBuilder.Current.SetControllerFactory(new ErrorHandlingControllerFactory())
and simply addHandleErrorWithElmahAttribute
to the global filters usingGlobalFilters.Filters.Add(new HandleErrorWithElmahAttribute());
Cheers, Dean