我有一个 ViewComponent 存储在一个名为“Dashboard”的区域中,但现在我想在另一个名为“Appplications”的区域中使用这个 ViewComponent。是的,我可以将它添加到根视图/共享文件夹,但我正在努力通过强大的区域使用来制作一个非常模块化的应用程序。
ASP.NET 5 RC1 MVC 6 似乎不支持对其他组件的跨区域引用。
如何添加其他视图位置?我需要添加:
/Areas/Dashboard/Views/Shared/Components/DashboardMenu/Default.cshtml
作为视图渲染器的搜索位置
InvalidOperationException: The view 'Components/DashboardMenu/Default' was not found. The following locations were searched:
/Areas/Applications/Views/Application/Components/DashboardMenu/Default.cshtml
/Areas/Applications/Views/Shared/Components/DashboardMenu/Default.cshtml
/Views/Shared/Components/DashboardMenu/Default.cshtml.