How can long running thread work inside web application

前端 未结 2 1471
别那么骄傲
别那么骄傲 2021-01-29 03:08

So I have inside MVC controller method the following code :

public ActionResult ProcessFile () 
{
    ThreadStart threadStart = new ThreadStart ( ()=>{

             


        
2条回答
  •  独厮守ぢ
    2021-01-29 03:50

    While the answer above is acceptable, there is some merit to having long running service like tasks hosted in your web app.

    Rick Strahl has a blog post about it here: Use-IIS-Application-Initialization-for-keeping-ASPNET-Apps-alive

提交回复
热议问题