Reputation: 1863
My MVC WebAPI project has been working fine, but suddenly it doesn't compile and I am getting the following error. I am using Attribute routing. I need both the assemblies reference. I've tried
\packages\Microsoft.AspNet.Mvc.4.0.30506.0 and \packages\Microsoft.AspNet.Mvc.5.2.2
Does anyone know how to fix this?
'RoutePrefixAttribute' is an ambiguous reference between 'System.Web.Http.RoutePrefixAttribute' and 'System.Web.Mvc.RoutePrefixAttribute'
'RouteAttribute' is an ambiguous reference between 'System.Web.Http.RouteAttribute' and 'System.Web.Mvc.RouteAttribute'
Upvotes: 3
Views: 4317
Reputation: 3825
Use full name [System.Web.Mvc.RoutePrefix("smt")]
or make alias for reference
using a =System.Web.Http;
using b = System.Web.Mvc;
[a.RoutePrefix("smt")]
Upvotes: 2