Async CTP–Fixing the Installation Problem
I wasn’t aware that the Async CTP worked with Windows Phone 7 until I read this good introduction by Kevin Ashley.It’s not just the await and async –keywords which got me excited, it’s the thought of using TPL with WP7.
Unfortunately getting the CTP 3 to install wasn’t an easy task. First time everything seemed to go alright, except I couldn’t find the samples or DLLs from anywhere. Turns out this is a common problem and it is caused by the Silverlight 5 and some Visual Studio Hotfixes.
Here are the steps I had to take in order to get the Async CTP installed:
- Removed Silverlight 5 SDK through Programs and Features
- Removed the following updates through Programs and Features / Installed Updates:
- KB2615527
- KB2635973
- KB2549864
All of these can be reinstalled after Async CTP has been installed.
After going through the steps described above, Async with WP7 is a go:
private async void ButtonClick(object sender, RoutedEventArgs e) { Debug.WriteLine(await GetWebpage()); } private async Task<string> GetWebpage() { return await new WebClient().DownloadStringTaskAsync(new Uri("http://www.bing.com")); }
Update: Thanks to lino to pointing out that also KB2645410 is known to cause issues.