dot net core mvc controller中的请求超时

时间:2017-06-29 19:30:55

标签: asp.net-core timeout asp.net-core-mvc

我从我的视图中调用一个控制器方法,这个方法有一些很长的过程

[HttpPost]
public async Task<IActionResult> MyControllerMethod(MyViewModel viewModel)
{
    await MyFile.Longprocess);
    return PartialView("_MyPartialPage");
}

当进程花费的时间超过2分钟时,我在调试模式下出现以下错误

  

发生错误:状态:错误,描述:错误网关

可悲的是,我没有在scriptTimeout中找到ASP .NET Core的任何解决方案,就像我们在MVC中一样

  

HttpContext.Current.Server.ScriptTimeout = 90000;

在某些RnD之后,我found outRequestTimeout="00:30:00"标记上设置aspNetCore只能在发布模式下运行,并且从Visual Studio调试模式运行时仍会出现问题。

那么有没有办法在Visual Studio 2017调试模式下设置超时?任何形式的帮助将不胜感激。

0 个答案:

没有答案