ConfigureAwait(true) not returning on the context it was awaited on
问题 Sample : static void Main(string[] args) { int counter = 0; var t = new System.Timers.Timer(); t.Interval = 3000; t.Elapsed += async (sender, e) => { Debug.WriteLine("Before await - Thread : {0} , Counter : {1}", Thread.CurrentThread.ManagedThreadId, counter); await Task.Delay(1000).ConfigureAwait(true); Debug.WriteLine("Ater await Thread : {0}, Counter : {1} ", Thread.CurrentThread.ManagedThreadId, counter); counter++; if (counter == 2) { Debug.WriteLine("Stop"); t.Stop(); } }; t.Start();