'System.Web.Routing.RouteCollection' does not contain a definition for 'MapHttpRoute'
<p>In the RoutingConfig.cs I added the below code for handling the Handling HTTP 404 Error in ASP.NET Web API</p>

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

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

        routes.MapRoute(
            name: "Error404",
            routeTemplate: "{*url}",
            defaults: new { controller = "Error", action = "Handle404" }
        );
    }
}
</code></pre>

<p>It throws the below error like </p>

<blockquote>
  <p>'System.Web.Routing.RouteCollection' does not contain a definition for
  'MapHttpRoute' and no extension method 'MapHttpRoute' accepting a
  first argument of type 'System.Web.Routing.RouteCollection' could be
  found (are you missing a using directive or an assembly reference?)</p>
</blockquote>

<p>I tried to ass the namespace <code>System.Web.Routing.RouteCollection</code> but it is not working</p>