I've added Tim McCalls AttributeRouting v.3.5.6 via the NuGet package. It seems straight forward enough, but area names and routeprefixes are not being applied to the routes shown in routes.axd.
Has anyone else experienced this?
I've added Tim McCalls AttributeRouting v.3.5.6 via the NuGet package. It seems straight forward enough, but area names and routeprefixes are not being applied to the routes shown in routes.axd.
Has anyone else experienced this?
I found the issue. It is a naming conflict. It appears that RouteArea and RoutePrefix are seen as objects in the System.Web.Mvc namespace, hence are not being applied to the AR routes.
This has been reported to Tim McCall, but he is to busy to work on the AR library anymore. You can see the comment thread here.
I want to be able to use the AR library with MVC5. Namely, because I want to take advantage of the precedence options. If you want to do the same then the following using statements and the conflict seems to resolve.
using AttributeRouting;
using AttributeRouting.Web.Mvc;
using RouteAreaAttribute = AttributeRouting.RouteAreaAttribute;
using RoutePrefixAttribute = AttributeRouting.RoutePrefixAttribute;