I try to use attribute based routing. But when i try the following snippet to activate attribute based routing i get the following error message:
RouteCollection' doesn't contain a definition for 'MapMvcAttributeRoutes
This is my code:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapMvcAttributeRoutes(); //Attribute Routing
}
}
These are the references:
using System;
using System.Web.Mvc;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;
Thre Framework version for my project is 4.5.2.
Whats wrong here and how i fix this?