单声道:ViewEngine 无法在 ~/Views/Home/ 中找到索引

本文关键字:Views Home 索引 声道 ViewEngine 单声道 | 更新日期: 2023-09-27 18:36:11

我目前正在将 ASP.NET MVC 4与Nginx服务器和fastcgi-mono-server4结合使用。尝试任何视图后,我得到:

System.InvalidOperationException
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
    ~/Views/Home/Index.aspx
    ~/Views/Home/Index.ascx
    ~/Views/Shared/Index.aspx
    ~/Views/Shared/Index.ascx
    ~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.Mvc.
Exception stack trace:
  at System.Web.Mvc.ViewResult.FindView (System.Web.Mvc.ControllerContext context) [0x00000] in           <filename unknown>:0 
  at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context)   [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17 () [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter (IResultFilter filter,   System.Web.Mvc.ResultExecutingContext preContext, System.Func`1 continuation) [0x00000] in <filename    unknown>:0 

但是,我想指出它在 IIS 上本地工作。此外,我检查了所有内容是否正在部署并重新启动了服务器,但此错误仍然存在。有什么帮助吗?

单声道:ViewEngine 无法在 ~/Views/Home/ 中找到索引

我相信

NGINX中的文件路径与IIS不同,是区分大小写的。