Emulator Troubleshooting/Tip 02: Emulator Connecting to Internet (Internet Pass-through Connectivity) Issue
====>SiteMap of this Blog<===
Emulator Troubleshooting/Tip 02: Emulator Connecting to Internet (Internet Pass-through Connectivity) Issue
The post "Emulator Troubleshooting/Tip 01: To Cradle or Not to Cradle?" is mainly regarding basic knowledge of the new Emulators. Essentially DMA channel is used by Visual Studio and Remote Tools to communicate with the Emulator. It is really NOT that necessary to always ActiveSync an emulator.
Internet Pass-through Connectivity
However, in a lot of cases, the emulator needs to be cradled and ActiveSync'ed. One common requirement is that the emulator wants to use host PC's networking capability, as if it were its own. You can use this feature to perform tasks such as downloading POP3 or IMAP4 email messages, to connect directly with a remote server, or to browse the Internet. This feature is called "Internet Pass-Through". My post briefly talks about how to make it. An excellent post from a Microsoft employee shows much detailed steps with screen cuts.
However, the Microsoft post and a lot of other similar articles only mention what to do in the emulator side. I want to emphasize here that you also need to take care of the ActiveSync side. ActiveSync needs to be instructed whether the host computer is connected to "Work Network" or "The Internet". See below for a screen cut and how to do it:
- Click Connection Settings.
- Select Open ActiveSync when my device connects.
- In the This computer is connected to list, select a connection to which this computer should connected when passing through ActiveSync.
If you are not sure what network to use, choose "Automatic". Hopefully ActiveSync can automatically find out which network the host PC is connected and adjust emulator's setting accordingly.
My Use Case
I am not the lucky one that ActiveSync magically finds out the network to use. It took me 30 minutes to figure out why all of a sudden the emulator in my home PC could not browse internet. Basically the ActiveSync setting is somewhat mysteriously changed to either "Work Network" or "The Internet". Here is my story:
I am using Comcast cable for internet access at home. Occasionally, when I work from home, I run a VPN software in my home PC to place it into the company's intranet. Once in the intranet, any external web site can only be accessed via a proxy server.
Therefore, the emulator in my home PC needs to have internet access in two distinct cases:
- My home PC is inside the corporate intranet. In the emulator side, a proxy server must be configured. In ActiveSync side, "Work Network" or "Automatic" must be used. The emulator cannot browse internet if "The Internet" is chosen in ActiveSync.
- After business hour, my home PC is directly connected to the public internet. In the emulator side, no special action needs to be taken. In ActiveSync side, "The Internet" or "Automatic" must be chosen. Again, the emulator won't connect if "Work Network" is chosen in ActiveSync.
Wrap Up
Next time when you fight with your emulator that cannot browse a public site, not only check whether the emulator is cradled and ActiveSync'ed successfully, but also check whether ActiveSync side is setup properly!