Search code examples
c#asp.net-mvcasp.net-mvc-4asp.net-web-apiattributerouting

How to do Attribute Routing in ASP.Net MVC4 and Web API 1 Project?


Is there any way to do attribute Routing in ASP.Net MVC4 and Web API 1 project? I have search so much about that only solution I found was update or install the project to MVC5, Web Api 2 and AttributeRouting. I tried to do it from nuget but having issues with supporting older version packages in the project(Install-Package AttributeRouting, Install-Package Microsoft.AspNet.WebApi, Install-Package Microsoft.AspNet.Mvc). Is there any way to do attribute routing with out updating or installing?


Solution

  • To avoid compatibility issues it is advised to update to a more recent version that supports attribute routing.

    I used the following walkthrough to successfully upgrade my ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2

    How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2