I have a .Net Mvc4 project, I've added a WebApi Controller and a basic action in for an ajax call.
When I call the method I get:
Inheritance security rules violated while overriding member: 'System.Web.Http.WebHost.Routing.HostedHttpRouteData.get_Route()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
I haven't made any custom modifications or set up anything for web Api to work (was I supposed to?)
I noticed the DefaultApi route is in my routeConfig. I'm also using Unity Mvc4 & Unity Web Api packages, (which I've disabled to test if it was causing the issue but doesn't seem to be).
My controller is TestController
action:
public bool ClearAwaitingNotifications()
{}
& ajax call is going to: api/test/clearawaitingnotifications
How can I fix this?