Device Emulator and Internet Connectivity
With the release of Visual Studio 2005, I have seen some confusion over how to connect the Device Emulator to the Internet. This post is an attempt to clear some of this confusion. Feedback welcome.
Connectivity changes from Beta2 to Final Release
The Desktop to Device Emulator connectivity story has changed quite radically between the Beta2 and the final release version of Visual Studio. Some of the default settings out of the box are different so you need to be aware of them. In the remaining part of this post I will focus only on the final version and point out where it differs from the Beta2 in a major way.
First, if you have Beta2 of Visual Studio 2005 please remove it using the uninstall steps at http://msdn.microsoft.com/vstudio/support/uninstall/default.aspx. If you used the uninstall tool, then it has been update to remove the DMA Transport Update but do make sure to check ‘Add Remove Programs’ to make sure it is not there before you install the final release version.
The rest of the post assumes that you have installed the final version of Visual Studio 2005 and (optionally) Windows Mobile 5.0 SDK.
Starting the Device Emulator
There are three ways to start the Device Emulator from Visual Studio 2005
- From Tools->Connect To Device-><pick one emulator from the list> ->Connect
- From Tools->Device EmulatorManager, then right click on any emulator from the displayed list and press ‘Connect’.
- Create a smart device project and either press F5 or Deploy Solution. Pick a particular emulator when the dialog comes up (in case of managed projects) or from right clicking on your project name in the solution explorer, select Properties and select Deployment (in case of native projects).
- There is a fourth way, from command line, to start the Device Emulator that we won’t touch upon in this post.
Visual Studio 2005 running on the desktop (henceforth called ‘Desktop’) interacts with the Device Emulator over a “DMA” channel. In Beta2, the Desktop – Device Emulator interaction occurred over TCP/IP stack. Think of DMA as a direct communication between two Windows processes (Visual Studio and Device Emulator) and hence it’s much more robust and fast than going over the network stack.
Confirm that you have the DMA Transport as the transport between Desktop and the Device Emulator. DMA Transport is the new default in Visual Studio 2005 final version. In Beta2 the default was the TCP/IP transport. When you select the ‘Properties’ for any emulator from Tools0->Options->Device Tools->Devices, you will see “DMA Transport’ under the Transport field. Note that while this can be changed to TCP Connect Transport (if you have the Virtual Network Switch Driver installed) it is NOT RECOMMENDED.
Enabling Internet Connectivity From the Device Emulator
When the Device Emulator starts up it acts like a physical device that is not cradled. As such it has no Internet connectivity (the Device Emulator has no “data” plan from a carrier to get any such connectivity “over the air” J). In order to “Cradle” the Device Emulator we need to start the Device Emulator Manager (Tools->Device Emulator Manager). The Device Emulator Manager would indicate the instance of the emulator currently running with a green arrow.
Right click on the instance of the emulator that is running (presumably only one in your case) that you want to cradle and select ‘Cradle’.
If you have ActiveSync 4.0 installed (the developer preview is available at http://download.microsoft.com/download/c/4/5/c45f8f83-6383-43d7-840b-cb9638484e4d/setup.exe) then ActiveSync will automatically detect that a new “device” has been connected. The Device Emulator Manager and the Device Emulator can work with ActiveSync 3.8 also but Visual Studio 2005 supports ActiveSync 4.0 only. You can either create a Guest partnership or a Standard partnership with the Device Emulator. I usually just hit ‘Cancel’ which automatically sets up a guest partnership.
Once ActiveSync is in the “Connected” state you should have Internet connectivity from the Device Emulator. If you are on a corporate network and access external web sites via a proxy server you will be prompted to set it up. The settings used here are similar to the ones that you would use to setup your desktop IE (Tools -> Internet Options -> Connections -> LAN settings)
At this point you can access the Internet, e.g. www.microsoft.com, from Pocket IE.
You can also access the local intranet web sites from the Device Emulator.
Enabling Internet Connectivity To the Device Emulator
This scenario is not supported out-of-the-box in Visual Studio 2005. If you need more information please let me know.