Why is Global.asax -> Application_Start not called when replacing myapp.dll?
The bottom line is that there are tasks that are performed in ThreadPool . If you replace myapp.dll, a ThreadAbortException will be thrown. I wrote a small code to restart these tasks and call it in Global.asax -> Application_Start . But nothing happens.
How can this be realized?
here is the startup code
public static void RunAllWorkingOrDivideTasks() { try { Task[] tasks = TaskDataManager.GetAllTasks(); if (tasks.Length > 0) foreach (Task task in tasks.Where(e => e.status == TaskStatus.active || e.status == TaskStatus.divide)) { ThreadPool.QueueUserWorkItem( new WaitCallback(delegate (object state) { Task(task.username, task.taskId); }), null); } } catch { } }