AttributeRouting v3.5.6前缀和未应用于路由的区域

时间:2014-04-12 22:31:07

标签: asp.net-mvc-4 attributerouting

我通过NuGet包添加了Tim McCalls AttributeRouting v.3.5.6。它似乎很直接,但区域名称和路由前缀不会应用于routes.axd中显示的路由。

还有其他人经历过这个吗?

1 个答案:

答案 0 :(得分:0)

我发现了这个问题。这是一个命名冲突。看起来RouteArea和RoutePrefix被视为System.Web.Mvc命名空间中的对象,因此不会应用于AR路由。

已向蒂姆·麦考尔报告,但他正忙着在AR图书馆工作。您可以看到评论主题here

我希望能够将AR库与MVC5一起使用。也就是说,因为我想利用优先选项。如果你想做同样的事情,那么以下使用语句和冲突似乎就解决了。

using AttributeRouting;
using AttributeRouting.Web.Mvc;
using RouteAreaAttribute = AttributeRouting.RouteAreaAttribute;
using RoutePrefixAttribute = AttributeRouting.RoutePrefixAttribute;