Faced the same problem. Checked all the answers here but my problem was in namespacing.
Routing attributes exists in System.Web.Mvc and in System.Web.Http. My usings included Mvc namespace and it was the reason. For webapi u need to use System.Net.Http.