I'm creating a WepApi on visual studio 2010, I've use NuGet for the api. Now when I'm registering the API in the Global File im getting the following error. The code below is found in the application_Start of the api.
protected void Application_Start(object sender, EventArgs e)
{
log4net.Config.XmlConfigurator.Configure();
RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = System.Web.Http.RouteParameter.Optional }
);
}
The following error is being given on $RouteTable.Routes.MapHttpRoute
- Instance argument:
cannot convert from 'System.Web.Routing.RouteCollection' to 'System.Web.Http.HttpRouteCollection'
Any suggestions why this error is given?