I'm currently moving a WebApi 1 to a WebApi 2 project with OWIN.
In this piece of code GlobalConfiguration is in System.Web.Http.WebHost.
public class HandlerErrorFilterAttribute : ExceptionFilterAttribute
{
public override void OnException(HttpActionExecutedContext context)
{
var logFactory = GlobalConfiguration.Configuration.DependencyResolver
.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
...
}
}
I think this is not Owin compatible, but I can't find how to rewrite this so I can access the dependency resolver.