webClient.DownloadStringTaskAsync().Wait() freezes the UI
问题 I am using silverlight 4, and the new async CTP. private void button1_Click(object sender, RoutedEventArgs e) { WebClient wb = new WebClient(); var t = wb.DownloadStringTaskAsync("http://www.google.com"); t.Wait(); } This code causes the UI to freeze. On the other hand, this code works fine : private void button1_Click(object sender, RoutedEventArgs e) { WebClient wb = new WebClient(); var t = Task.Factory.StartNew(() => Debug.WriteLine("Doing something")); t.Wait(); } Whats the difference