I have a WP7 game that uses RESTsharp to communicate with my MVC4 RESTful server, but I often have issues making requests that work and therefore I want to debug where it fa
Another way is to add an event handler in Global.asax.cs to pick up the incoming request and then look at the route values in the VS debugger. Override the Init method as follows:
public override void Init()
{
base.Init();
this.AcquireRequestState += showRouteValues;
}
protected void showRouteValues(object sender, EventArgs e)
{
var context = HttpContext.Current;
if (context == null)
return;
var routeData = RouteTable.Routes.GetRouteData(new HttpContextWrapper(context));
}
Then set a breakpoint in showRouteValues and look at the contents of routeData.
Keep in mind that in a Web API project, the Http routes are in WebApiConfig.cs, not RouteConfig.cs.