You can best achieve what you want in Silverlight using WebClient.OpenReadCompleted and OpenReadAsync. This will return the stream. You can use this directly or copy the stream into bytes [], as described here, for example: http://www.yoda.arachsys.com/csharp/readbinary.html
Also, be careful that the Silverlight functionality for WebClient is NOT a subset of .NET. If it were a subset, then what they both did, they would do the same. But this is not so. For example, SL4 OpenReadAsync is truly asynchronous. It does not block the calling thread at all. However, in .NET4, OpenReadAsync and DownloadDataAsync partially block the calling thread and block it while it is running in the debugger. To get a truly non-UI-blocking effect in .NET4, you need to start the download in a separate thread yourself. In addition, in Silverlight, DownloadProgressUpdated works great at boot time for OpenReadAsync. In .NET, this is not so. However, .NET DownloadDataAsync launches DownloadProgressUpdated in a very similar fashion to Silverlight OpenReadAsync.
So, if you want to achieve consistency between the WPF project and Silverlight, you can use OpenReadAsync directly on the SL side. On the WPF side, run DownloadDataAsync in a separate thread:
Thread downloadThread = new Thread(new ThreadStart(() => wc.DownloadDataAsync(uri))); downloadThread.Start();
Then in DownloadDataCompleted, create a MemoryStream from the returned byte [] if you prefer it in streaming form. (I did not find any extra overhead to significantly affect performance.)
source share