I am creating a wp7 application. I use WebClient to capture data from the server. It used to work, although suddenly it didn’t work.
static void downloadData(string uri, Action<object, DownloadStringCompletedEventArgs> onComplete) { Debug.WriteLine("Downloading: " + uri); WebClient data = new WebClient(); data.DownloadStringCompleted += new DownloadStringCompletedEventHandler(onComplete); data.DownloadStringAsync(new Uri(uri)); } static void data_SectionDownloadCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) {
When I go to the URI in question in my browser, it works fine.
An exception:
"The remote server returned an error: NotFound." {System.Net.WebException}
What am I doing wrong here?
Update . I restarted the emulator and now it works fine. Weird Maybe this is a problem in the emulator? I hope I can not play it on the device itself.
source share