Introduction

 

You can write asynchronous programs more easily and intuitively by using features that are introduced in Visual Studio 2012. You can write asynchronous code that looks like synchronous code and let the compiler handle the difficult callback functions and continuations that asynchronous code usually entails.

The projects in this sample accompany Walkthrough: Accessing the Web by Using Async and Await. The walkthrough starts with a synchronous Windows Presentation Foundation (WPF) application (project SyncWalkthrough) that sums the number of bytes in a list of web sites. The walkthrough then converts the application to an asynchronous solution by using the new features (projects AsyncWalkthrough and AsyncWalkthrough_HttpClient).

 

Building the Sample

 

1. Unzip the downloaded file.

2. Open Visual Studio 2012.

3. On the menu bar, choose File, Open, Project/Solution.

4. Navigate to the directory that holds the unzipped sample.

5. Open the solution (.sln) file.

6. In Solution Explorer, open the shortcut menu for the project you want to run and then choose Set as StartUp Project.

7. Choose F5 or Ctrl+F5 to build and run the sample

 

Description

The sample contains the following three projects:

 

More Information

For more information and step-by-step instructions, see Walkthrough: Accessing the Web by Using Async and Await.