I have created One Filter Attribute
public class AuthFilterAttribute : System.Web.Http.Filters.ActionFilterAttribute { public AuthFilterAttribute() { } public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext) { } } I have registered this filter inside the global.asax.cs.
When I am trying to call my web API using Postman it is showing the error:
Method not found: 'System.Net.Http.HttpRequestMessage System.Web.Http.Controllers.HttpActionContext.get_Request()'.
My project target framework is 4.6.1 and the System.Net.Http version is 4.2.0.0
My API looks like this:
[AuthFilter] public class ScheduleApiController : BaseApiController { [Route("api/v1/schedules")] [HttpGet] public IHttpActionResult GetSchedules() { } } I know this question has been asked before but none of the solutions worked for me.
Please help me to resolve this issue.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\libIf so, try deleting/renaming it.