I was working on a migration job from Asp.net MVC4 beta to Asp.net MVC4, But I had a problem of dll reference missing. please help me .
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = System.Web.Http.RouteParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Login", action = "Login", id = UrlParameter.Optional }
);
}
Above the code can't be compiled successfully, and Visual studio said System.Web.Routing.RouteCollection' does not contain a definition for 'MapHttpRoute' and no extension method 'MapHttpRoute' accepting a first argument of type 'System.Web.Routing.RouteCollection' could be found (are you missing a using directive or an assembly reference?)
More important thing is this kind of problem often happened.Because the version of the Asp.net MVC change so frequently in these days. and So did the version of Windows Azure Client ApI. It is very annoying problem.I hope someone can give some advise of How to deal with it. thanks.