System.Net.Webclient not working 'WebClient' could not be found

I am trying to work with WebClient but it is giving me errors so I check in several forums (included this one) and they where telling to put

In the top of the file:

using System.Net 

And after where I want use the WebClient:

 WebClient webClient = new WebClient();
 webClient.DownloadFile ("http://mysite.com/myfile.txt", @"c:\myfile.txt");

And I get this error:

The type or namespace name 'WebClient' could not be found (are you missing a using directive or an assembly reference?)

In the other forums the code that I just wrote above seems to be the solution but is not working for me.

Jon Skeet
people
quotationmark

Given your tags, it sounds like you may be building a Windows Store app - in which case you need to use HttpClient instead of WebClient.

people

See more on this question at Stackoverflow