I am using Visual Studio 2012 (RTM) to create an MVC 4 project that uses Web API endpoints, and I am trying to get the OData querying to work.
I just tried to install the latest nightly build of the OData nuget package, and now when I run my application, I get this error:
Method not found: 'System.Web.Http.Services.DefaultServices System.Web.Http.HttpConfiguration.get_Services()'.
It occurs when I try to add a custom action filter:
and this is the ValidationActionFilter code:
public class ValidationActionFilter : System.Web.Http.Filters.ActionFilterAttribute
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
var modelState = actionExecutedContext.ActionContext.ModelState;
var errors = new Dictionary<string, string>();
foreach (var key in modelState.Keys)
var state = modelState[key];
var res = new HttpResponseMessage(HttpStatusCode.BadRequest);
res.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
actionExecutedContext.Response = res;
From what I found Googling that exception with Bing, the error means that I have an older version of the MVC 4 binaries in my GAC.
I'm not gacutil wizard, but I couldn't find any references to any older version of MVC 4.
The project was working before I updated and the only thing that has changed is installing the latest nuget package.
The version that was working was: X.0.20505
The version that is not working is: X.0.20710