title: How to create a long running background task from MVC
body: <p>I am using EF6, MVC 5 in VS 2013. I have a long-running task which is causing timeout errors and so I want to set it running as a separate background task and return immediately to the web controller. The background task will report progress to an SQL server database. What I need, essentially, is <strong>fire and forget</strong> functionality. There appear to be a number of options:</p>
  <ol>
  <li>Write the task's details to a server and use a Windows service to process them <strong>UPDATE</strong>: <em>this was the options used</em></li>
  <li>Use <code>async</code> - this does not seem to be a safe option</li>
  <li>Use <code>HostingEnvironment.QueueBackgroundWorkItem</code> method</li>
  </ol>
  <p>Option 3 would be preferred as it keeps all the code in one solution. Please could you comment on the pros and cons of each and point, if possible, working examples of number 3?</p>