我正在從Asp.net MVC4測試版遷移到Asp.net MVC4,但我遇到了缺少dll參考的問題。請幫幫我 。將Asp.net MVC4從測試版遷移到4時缺少組件參考
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 }
);
}
上面的代碼不能成功編譯,和Visual Studio說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?)
更重要的是,這樣的問題往往happened.Because的Asp.net MVC變化的版本,以便在頻繁這些天。和Windows Azure Client ApI版本一樣。這是一個非常煩人的問題,我希望有人能提出一些建議如何處理它。謝謝。
老闆。真正。真正。 –