This thing is killing me. Basically what I have is the custom ActionFilter (Class which Inherits from ActionFilterAttribute and implements IActionFilter). it looks like this
public class ValidationFilterAttribute : ActionFilterAttribute, IActionFilter
{
public override void OnActionExecuting(HttpActionContext actionContext)
{
// do some stuff here
}
}
this is what FilterConfig looks like
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new ValidationFilterAttribute());
}
}
But whenever I start the project there is an exception saying following
The given filter instance must implement one or more of the following filter interfaces: IAuthorizationFilter, IActionFilter, IResultFilter, IExceptionFilter.
But obviously the ValidationFilterAttribute implements one of those interfaces. Am I missing something very basic here? I can't figure out what is wrong.