Long-running background process in ASP.NET - Application_Start or separate process?
问题 I'm developing a .NET 4 application that requires a backend worker thread to be running. This thread consists mostly of the following code: while (true) { //Check stuff in database //Do stuff //write to database / filesystem Thread.sleep(60000) } The ASP.NET app is just a frontend for the database. My question is around where the best place to put this worker loop would be. It seems my immediate two choices would be (1) to spin it off from the Application_Start method, and just let it run, or