title: Timeouts with long running ASP.NET MVC Core Controller HTTPPost Method
body: <p>I make use of  ajax call in my <code>ASP.NET Core MVC</code> view pages</p>
  
  <p>MyView.cshtml</p>
  
  <pre><code>          $.ajax({
                  processData: false,
                  contentType: false,
                  data: new FormData(this),
                  type: $(this).attr('method'),
                  url: $(this).attr('action'),
                  cache: false,
                  success: function (data) {
                          $('#mydiv).html(data);
                          $('#bootstrapModal).modal('show');
  </code></pre>
  
  <p>Controller Post method"</p>
  
  <pre><code>    [HttpPost]
      [ValidateAntiForgeryToken]
      public async Task&lt;IActionResult&gt; MyLongRunningMethod(MyViewModel viewModel)
      {
          await MyProcess.Longprocess1();
          await MyProcess.Longprocess2();
          await MyProcess.Longprocess3();
          await MyProcess.Longprocess4();
          return PartialView("_MyPartialPage");
      }
  </code></pre>
  
  <p>This works but only has an issue for a long running process. I get the following error during debug mode when the process takes longer than around 2 minutes</p>
  
  <p><a href="https://i.stack.imgur.com/CERlr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CERlr.png" alt="enter image description here"></a></p>
  
  <p>I understand this is to do with expiration timeout</p>
  
  <p>in previous versions of ASP.NET MVC you can apparently increase the timeout in your asp.net controller action.</p>
  
  <pre><code>HttpContext.Current.Server.ScriptTimeout = 90000;
  </code></pre>
  
  <p>However this doesn't exist in <code>ASP.NET Core</code></p>
  
  <p>I want to increase the timeout for debugging and deployment for a particular asp.net controller.</p>
  
  <p>For production I can set it globally in the <code>web.config</code> by adding requestTimeout to the existing httpPlatform tag.
  e.g. for 10 minutes</p>
  
  <pre><code>&lt;httpPlatform requestTimeout="00:10:00" ....
  </code></pre>
  
  <p>A similar question was asked but the <a href="https://stackoverflow.com/questions/34637488/how-do-i-set-the-request-timeout-for-one-controller-action-in-an-asp-net-5-mvc-6">answer</a> giving using an <code>CancellationToken</code> but reading it, it doesn't seem it can help me with the timeouts.</p>
  
  <ol>
  <li>How do I set the timeouts in Visual Studio 2015 debug mode like I can do when I deploy it?</li>
  <li>IS there a per controller timeout setting like there was in <code>ASP.NET 4</code>?</li>
  </ol>