为了提高mvc的速度,在Global.asax中移除WebFormViewEngine
protected void Application_Start() { RemoveWebFormEngines(); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } void RemoveWebFormEngines() { var viewEngines = ViewEngines.Engines; var webFormEngines = viewEngines.OfType<WebFormViewEngine>().FirstOrDefault(); if (webFormEngines != null) { viewEngines.Remove(webFormEngines); } }