RouteCollection 'does not contain a definition for' MapMvcAttributeRoutes

I just had to downgrade my ASP.Net 4.5.2 application to ASP.Net 4.0. Of course, this creates problems with it, for example, links that are not installed true. I have solved some of them already, but I can not ponder the error:

CS106 'RouteCollection' does not contain a definition for 'MapMvcAttributeRoutes' and the extension method 'MapMvcAttributeRoutes' takes the first argument of the type 'RouteCollection' can be found

public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes) {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapMvcAttributeRoutes();

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "device", action = "view", id = UrlParameter.Optional });
        }
    }

Does anyone know what should I do here?

Additional Information

Namespaces I use:

  • using System.Web
  • using System.Web.Mvc
  • using System.Web.Routing
  • , System.Web.Http

Visual Studio 2015

+4
1

MVC, ( MapMvcAttributeRoutes), MVC 5.

MVC 5 .NET framework 4.5 .

, 2 :

  • .NET Framework 4.5 +
  • MVC 4 :
    • Ditch
    • , MVC 3 4

Microsoft - .NET Framework 4.5.2 ( 3.5, MVC 2 ), .

+6

All Articles