视图'路由'没有找到,但实际上存在于Nopcommerce 4.5.2
出现: 处理请求时发生了一个未经治疗的例外。 InvalidOperationException:找不到视图'/ogs/route.cshtml'。搜索了以下位置:/ogs/route.cshtml ,
尽管该文件存在于第一个路径上: nop.web =>区域=> admin =>视图=> ogs => rout.cshtml
这是控制器代码,
public class OGSRoute : BaseAdminController
{
public virtual async Task<IActionResult> Index()
{
return View("/OGS/Route.cshtml");
}
}
Appears:
An unhandled exception occurred while processing the request.
InvalidOperationException: The view '/OGS/Route.cshtml' was not found. The following locations were searched: /OGS/Route.cshtml
Although the file is present on the first path:
Nop.Web => Areas => Admin => Views => OGS => Route.cshtml
Here is the controller code,
public class OGSRoute : BaseAdminController
{
public virtual async Task<IActionResult> Index()
{
return View("/OGS/Route.cshtml");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请尝试此视图名称:区域/admin/view/ogs/route.cshtml
Please try this viewName: Areas/Admin/Views/OGS/Route.cshtml
如下所示
Change like below