When you use the Visual Studio 2008 Remote Tools Framework with a device that runs Windows Embedded Compact 7, you can connect your device to Visual Studio by using TCP or kernel independent transport layer (KITL). For the bootstrap service, you can also use ActiveSync. Depending on your needs, you may not want to include KITL or ActiveSync support in your OS. Here, we describe how to connect your device to Visual Studio and use the Remote Tools Framework by using only TCP.

There are two ways to establish connectivity with your device over TCP. Method 1 uses a program called TCPBootstrapA to find the IP address of the device, which allows you to select the device by name. In Method 2, you need to find the IP address of the device manually. Each technique is described below.

 Caution:
For security reasons, use the connectivity methods described in this article only during development. Do not use these methods in a production environment.

In this article:


Prerequisites

Ensure that your setup meets the following requirements:

OS Design

  • Your OS supports network connectivity and TCP/IP.
  • For Method 2, your OS supports IpConfig (SYSGEN_NETUTILS).

Network Connectivity

  • Your device is connected to a network and is able to obtain a valid IP address.
  • Your development computer and your device are on the same subnet. If they are not, use a router that forwards broadcasts.

Virtual CEPC (if that is your device)

  • Your virtual CEPC (vCEPC) is stand-alone. That is, when you start the vCEPC, it automatically boots the OS; you are not downloading the OS image to the vCEPC from Platform Builder. (For instructions on how to set up a stand-alone vCEPC, see Advanced Virtual CEPC.)

Method 1 (Using TCPBootstrapA to Locate the Device)

TCPBootstrapA, which is a program included with the Remote Tools Framework, obtains the IP address of the device and displays it in the form of a device name. This way, within the Remote Tools Shell, you can select the device easily. Follow the instructions below to use the Remote Tools Framework by using TCP Bootstrap to locate the device.

To use TCPBootstrapA to locate the device
  1. Prepare the device
    1. On the device, start the OS.

    2. Copy TCPBootstrapA.exe from your development computer to the device. On your development computer, this file is in C:\Program Files\Microsoft Remote Framework Tools\1.10\target\wce700\<Hardware Platform>. For example, for the vCEPC, which is based on the x86 hardware platform, the location of TCPBootstrapA.exe is C:\Program Files\Microsoft Remote Framework Tools\1.10\target\wce700\x86.

      Alternatively, you can incorporate the file into the OS by following the instructions in How to Incorporate Files into an OS. If you add a file to the OS, you must rebuild the OS, but after it is rebuilt, you will not need to manually copy the file each time.

    3. On the device, at a command prompt, type: TCPBootstrapA.exe

       Note:

      To prevent the TCP Bootstrap service on the device from prompting for connection confirmation, you can start TCPBootstrapA.exe on the device by typing: TCPBootstrapA.exe /acceptall

      After you finish using the Remote Tools Framework, you may want to shut down the TCP Bootstrap service on the device for security reasons. To do so, open a different Command Prompt window and type TCPBootstrapA.exe /shutdown or type TCPBootstrapA.exe and then, in the TCP Bootstrap dialog box that appears, click Yes to confirm that you want to shut it down.

  2. Prepare the development computer
    1. On the development computer, start the Remote Tools Shell. To access the Remote Tools Shell, click Start, then All Programs, then Microsoft Remote Tools Framework 1.10, and then Remote Tools Shell.

    2. In the Remote Tools Shell, click Connection, and then click Manage Devices.

    3. Expand Windows CE, click Windows CE Device, and then click Properties.

    4. Select Show all registered transports and Show all registered bootstraps.

    5. Under Transport, select TCP Connect Transport.

    6. Under Startup, select TCP Bootstrap, and then click Configure.

    7. Your device appears under Active Devices. Double-click it to select it as the target device, and then click OK.

       Note:

      If your device did not appear under Active Devices, verify that you started tcpbootstrapa.exe (or tcpbootstrapa.exe /acceptall) on the device. Also, verify that your development computer and your device are on the same subnet (if not, you must have a router that forwards broadcasts).

      If you cannot get your device to appear under Active Devices, try the CoreCon connection method described later in this article.

    8. Click OK as needed to exit the configuration dialog boxes.

  3. Establish a connection
    1. On the development computer, in the Remote Tools Shell, start a remote tool by doing one of the following:

      • Click File, click Collect Live Data, and then click a remote tool from the list.
      • In the Remote Tools Shell window, in the Collect Live Data pane (which is below the Getting Started pane), click a remote tool.

       An Options dialog box appears.

    2. In the Options dialog box, expand Physically Connected Devices, select Mobile and Embedded Device, and then click OK.

       Important:
      Always select Mobile and Embedded Device, even if you are using a vCEPC or if you have created a custom device that shows up in the device list.
    3. On the device, in the TCP Bootstrap, A connection request has been received. Allow the client to connect? dialog box, click Yes.

       Note:
      This dialog box will not appear if you used the /acceptall option when starting TCPBootstrapA.exe.

      The development computer and the device establish a connection, and the remote tool is started.


Method 2 (Obtaining the IP Address of the Device Manually)

This method does not use TCPBootstrapA, so you need to specify the IP address of the device manually in Visual Studio. Follow the instructions below.

To specify the IP address of the device in Visual Studio
  1. Prepare the device
    1. On the device, start the OS.

    2. Copy the CoreCon files from your development computer to the device (if they are not already on the device). 

      On your development computer, these files are automatically installed when you install Visual Studio 2008. They typically install to C:\Program Files\Common Files\Microsoft Shared\CoreCon\1.0\Target\Wce400\<Hardware Platform>. For example, for the vCEPC, which is based on the x86 hardware platform, these files are in C:\Program Files\Common Files\Microsoft Shared\CoreCon\1.0\Target\Wce400\x86.

      The CoreCon files to copy to your device are:

      • clientshutdown.exe
      • CMAccept.exe
      • ConmanClient2.exe
      • eDbgTL.dll
      • TcpConnectionA.dll

      Alternatively, you can incorporate the CoreCon files into the OS by following the instructions in How to Incorporate Files into an OS. If you add the files to the OS, you must rebuild the OS, but after it is rebuilt, you will not need to manually copy the files each time.

    3. On the device, at a command prompt, type ipconfig to get the IP address of the device. The Command Prompt window displays the Ethernet adapter settings. Make a note of the IPv4 address. (If the Ethernet adapter settings are not displayed, your OS may not include support for ipconfig, which is provided through the Network Utilities catalog item (SYSGEN_NETUTILS).)

  2. Prepare the development computer
    1. In Visual Studio, click Tools, and then click Options.

    2. In the Options dialog box, expand Device Tools, and then click Devices.

    3. Under Show devices for platform, select All Platforms.

    4. From the Devices list, select Windows CE Device, and click Properties.

       Important:
      Always select Windows CE Device even if devices you have created show up in the device list.
    5. Under Transport, select TCP Connect Transport, click Configure, select Use specific IP address, and enter the device’s IP address that you obtained in a previous step.

    6. Under Bootstrapper, select TCP Bootstrap.

    7. Click OK as needed to exit the Options dialog box.

    8. On the development computer, start the Remote Tools Shell. To access the Remote Tools Shell, click Start, then All Programs, then Microsoft Remote Tools Framework 1.10, and then Remote Tools Shell.

  3. Establish a connection

    Before starting this step, we recommend that you read it completely because of the limited time available to make the connection and because of security concerns. While your device is trying to connect, security is temporarily disabled and you have only three minutes to initiate a connection between your development computer and your device, or you must try again.

    1. On the device, at a command prompt, type: ConmanClient2

    2. On the device, open another Command Prompt window and type CMAccept. CMAccept temporarily disables the device’s security to enable the development computer to connect to the device.

       Important:

      Quickly move to the next step because you have only three minutes to initiate a connection between your development computer and your device.

      The three-minute window is enforced by CMAccept. CMAccept temporarily disables the device’s security, so it only runs for three minutes before it returns (it also returns once a connection is established). You can eliminate the CMAccept step by disabling security on the device during development. To do so, set HLKM\System\CoreConOverrideSecurity = 1 DWORD value in the registry. For information on how to change registry settings, see the video Compact 7 OS Design - Editing the registry. Disabling security exposes your device to malicious attack and we do not recommend it unless you have provided appropriate safeguards.

    3. On the development computer, in the Remote Tools Shell, start a remote tool by doing one of the following:

      • Click File, click Collect Live Data, and then click a remote tool from the list.
      • In the Remote Tools Shell window, in the Collect Live Data pane (which is below the Getting Started pane), click a remote tool.

      An Options dialog box appears.

    4. In the Options dialog box, expand Physically Connected Devices, select Mobile and Embedded Device, and then click OK. The development computer and the device establish a connection, and the remote tool is started. (If a connection cannot be established, it may be because the three-minute connection initiation window has expired. On the device, restart CMAccept and try to connect again.)

       Important:
      Always select Mobile and Embedded Device, even if you are using vCEPC or if you have created a custom device that shows up in the device list.

      After you establish the initial connection between your development computer and the device, you can use different remote tools that you access through that instance of the Remote Tools Shell. (If you close and restart the Remote Tools Shell, or if you start another instance of the Remote Tools Shell, you will need to restart CMAccept.)


Community Resources


See Also