Error while configuring routes for WebAPI using MapHttpRoute
<p>I had an ASP.Net web application with WebAPI that was built on Frameworks 4.0 and Visual Studio 2013. </p>

<p>Recently the system was formatted and Visual Studio 2015 was installed. Now I am unable to map the routes for the WebAPI in Global.asax file.</p>

<p>Below is the code I use to configure the routes. </p>

<pre><code>RouteTable.Routes.MapHttpRoute(
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{action}/{id}",
        defaults: new { id = System.Web.Http.RouteParameter.Optional }
        );
</code></pre>

<p>I keep getting the error below.</p>

<p><em>'RouteCollection' does not contain a definition for 'MapHttpRoute' and the best extension method overload 'HttpRouteCollectionExtensions.MapHttpRoute(HttpRouteCollection, string, string, object)' requires a receiver of type 'HttpRouteCollection'</em></p>

<p>using Nuget package manager, I tried reinstalling ASP.NET MVC4 which was being used in the old code. I installed/reinstalled WebAPI, both the latest version and the old version that was being used before. I tried using System.Web.Http (again latest version and 4.something version that was used before) but i keep getting the above error. Please help!</p>