双11上云狂欢,0.5折起爆品开抢
Logo

博客

2021-2-17 xoyozo 转载请注明出处

fail: Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor[3]

      The view 'Index' was not found. Searched locations: /Areas/AAA/Views/XXX/Index.cshtml, /Areas/AAA/Views/Shared/Index.cshtml, /Views/Shared/Index.cshtml

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]

      An unhandled exception has occurred while executing the request.

      System.InvalidOperationException: The view 'Index' was not found. The following locations were searched:

      /Areas/AAA/Views/XXX/Index.cshtml

      /Areas/AAA/Views/Shared/Index.cshtml

      /Views/Shared/Index.cshtml


开发环境一切正常,发布到服务器上出现上述错误,找不到视图文件,可视图文件明明就存在。

尝试新建一个文件,将 Index.cshtml 文件的内容拷贝到新文件中保存,删除原文件,将新文件改名为 Index.cshtml,发布,OK。

679 阅读

最新发布

13 天前
OBS 自动切换场景 92 次阅读
26 天前
Channel was closed. 61 次阅读
29 天前

大家在看

2302 次阅读
0x80042468 发布于 5 年前
3676 次阅读
2661 次阅读