【问题标题】:mono The view 'Index' or its master was not found未找到视图“索引”或其主视图
【发布时间】:2016-04-10 07:28:07
【问题描述】:

本教程http://www.davidloo.com/?p=479 我安装了 monodevelop 并创建了 ASP.NET MVC 项目。 但是当我运行 F5 所以我有这个输出:

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) [0x00092] in <filename unknown>:0 
  at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context) [0x00044] 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+<InvokeActionResultWithFilters>c__AnonStorey5.<>m__0 () [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter (IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext, System.Func`1 continuation) [0x00025] in <filename unknown>:0 

版本信息:4.2.1(稳定版 4.2.1.102/6dd2d0d Thu Nov 12 09:52:44 UTC 2015); ASP.NET 版本:4.0.30319.17020 由 Mono 提供支持

MonoDevelop 我有 6.0 版本

并且文件:Views/Home/Index.cshtml 存在

你知道有什么问题吗? 谢谢

【问题讨论】:

    标签: c# asp.net asp.net-mvc mono monodevelop


    【解决方案1】:

    当您的代码尝试产生真正的async 执行时,所描述的异常会在单声道中发生。

    Mono 不支持 async 管道。

    我对单声道like described in this GitHUB post 提出拉取请求。它使异步 Web API 堆栈的同步执行。

    它源自这些 SO 问题:

    现在您可以使用 async 管道来修复 Mono。

    【讨论】:

      【解决方案2】:

      我收到了同样的错误。我在我的 Windows 机器上编译,但在 Raspbian 中的 Mono 上运行。所以当我输入它时,我应该注意大小写。

      我输入了一次“index”而不是“Index”,chrome 不会简单地让我重新输入它以包含大写“I”。

      然后我更改文件名以匹配只是为了传递错误并加载我的页面。

      【讨论】:

        猜你喜欢
        • 2011-01-17
        • 1970-01-01
        • 2020-06-29
        • 2013-06-23
        • 2012-04-29
        • 2013-08-18
        • 2012-08-21
        • 1970-01-01
        相关资源
        最近更新 更多