Domanda

I'm trying to debug an application that is making a WebRequest synchronously, ie.:

HttpWebRequest req = WebRequest.Create(new Uri("http://www.stackoverflow.com/")) as HttpWebRequest;

IAsyncResult res = req.BeginGetResponse(callback => { }, req);
while (!res.IsCompleted)
{
    System.Threading.Thread.Sleep(100);
}
// Doesn't matter what's here, as `res.IsCompleted` never returns true

This is just to check that some of the application logic is "right", but it's getting stuck, with the IAsyncResult never reporting itself as complete.

To check, things, I tried to use Internet Explorer on the emulator, but found that is unable to find any webpages (including the built in favourites), which makes me think that the emulator is trying to use a specific network interface on my laptop, but there doesn't seem to be any way to configure it, or which interface to use? I have a suspicion that it may be trying to use a VPN interface, or a virtual adaptor like the one for VirtualBox. So, how can I configure it? additionally, would you expect requests made by the emulator to show up in Fiddler?

For the record, NetworkInterface.GetIsNetworkAvailable() returns true;

UPDATE:

It appears that updating my graphics driver (and associated reboot) allowed the emulator to access the real network (or at least guess the right adapter); however, res.IsCompleted still doesn't report true (and Fiddler shows the request has completed), so I'm a little confuddled.

È stato utile?

Soluzione

Are you using a proxy? The Windows Phone emulator is tied to the currently active Internet Connection, as well as the proxy settings. Make sure those are set up correctly. Also, there might be a firewall blocking Internet access for XDE - check the settings too.

I would recommend getting Fiddler. Attempt to configure it to capture emulator traffic and see what information you can get from there.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top