mono The view 'Index' or its master was not found

半腔热情 提交于 2019-12-23 09:34:00

问题


by this tutorial http://www.davidloo.com/?p=479 I installed monodevelop and created ASP.NET MVC project. but when I run F5 so I have this output:

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 

Version Information: 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Nov 12 09:52:44 UTC 2015); ASP.NET Version: 4.0.30319.17020 Powered by Mono

MonoDevelop I have in 6.0 version

And file: Views/Home/Index.cshtml exists

Do you know anybody what can be wrong?? Thanks


回答1:


The described exception happens in mono when your code tries to produce really async execution.

Mono does not support the async pipeline.

I make pull request for mono like described in this GitHUB post. It makes synchronous execution of asynchronous web API stack.

It is derived from these SO questions:

  • Mono .Net support for async await?
  • Mono with Owin Authentication
  • 404 response appended to webapi response
  • Mono: The view 'Index' or its master was not found

Now you may use async pipeline with this fix for Mono.




回答2:


I received the same error. I was compiling on my windows machine but running on Mono in Raspbian. So when I typed it in I should have been paying attention to case.

I typed "index" instead of "Index" once and chrome would not simply let me retype it to include the capital "I".

I then change the file name to match just to get passed the error and my page loaded.



来源:https://stackoverflow.com/questions/34629192/mono-the-view-index-or-its-master-was-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!