How to use async in ASP.Net MVC for Mono

心已入冬 提交于 2020-01-04 05:27:11

问题


I am creating an ASP.Net MVC project in Mono using Visual Studio 2017 for Mac. I added the basic controllers, view, models, etc and it's working fine. However, as soon as make the Index method async I am getting the following error:

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.

This is the code:

public async Task<ActionResult> Index()
{
   ...
}

Searching for some information I found that seems the Mono project doesn't support the async pipeline (mono The view 'Index' or its master was not found)

And in the Mono project website (https://www.mono-project.com/docs/about-mono/compatibility/) it describe the different compatibility characteristics by version.

Does anyone know any workaround to use async in Mono? Or when it will be supported?

Thanks

来源:https://stackoverflow.com/questions/49848492/how-to-use-async-in-asp-net-mvc-for-mono

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