I want to download some pictures from the website at the same time using the Task in C #. The application hangs when call WaitAll (). Here is my code:

```
HttpClient client = new HttpClient() { MaxResponseContentBufferSize = 1000000 };

List<Task<byte[]>> tasks = new List<Task<byte[]>>();

for (int i = 0; i < 10; i++)
        {
            string url = string.Format("http://www.myurl.com/files//53/{0}page.jpg",i);
            Task<byte[]> download = ProcessURLAsync(url, client);
            tasks.Add(download);
        }

Task.WaitAll(tasks.ToArray());

```

And method ProcessURLAsync:

```
async Task<byte[]> ProcessURLAsync(string url, HttpClient client)
    {
        var byteArray = await client.GetByteArrayAsync(url);
        return byteArray;
    }

```