I am building an ASP.NET application using WPF with a long-running asynchronous Task that, in some cases, needs to ask the user for some more info. Is there a way I could interrupt, but not cancel, the task, wait for the user to respond and continue based on the result?All I have found are ways to use callbacks before and after the task. I have tried invoking UI thread methods via \[code\]Send()\[/code\] of a SynchronizationContext passed from the main thread, but it (sometimes) throws Null Reference Exception.To be more specific, I am unable to understand why this code throws NullReferenceException when it calls Send():\[code\]protected void Page_Load(object sender, EventArgs e){ Task task = new Task(DoSomeWork, new Tuple<SynchronizationContext, object>(SynchronizationContext.Current, new object())); task.Start();}public void DoSomeWork(object state){ Tuple<SynchronizationContext, object> cst = (Tuple<SynchronizationContext, object>)state; cst.Item1.Send(Writer, "Message");}public void Writer(object s){ Label1.Text = (s as string);}\[/code\]