Most likely you have a mismatch in versions of Web Api 2. No matter which version of MVC your controller is Web Api, so you need to pay attention to the assemblies associated with Web Api.
Iām sure that if you check the version of System.Web.Http both in the MVC project and in your class library, they will be different, and therefore the detection mechanism will not be able to find your custom filter. Just fix the problem by matching them and it should work.
One easy way to fix this is to link to the latest Web Api 2 package ( Microsoft.AspNet.WebApi.Core ) in your class library and update the same package in your MVC project to match (or by messing with assembly redirection if you like that). If, for example, you simply copied the code into a class library and then used something like Resharper to resolve links, most likely he selected version 4.x from System.Web.Http from GAC instead of version 5.x, which you need here.
I tried what you did, and he reproduced your problem, and this procedure solved it.
Wasp source share