May 2003
Updated August 2003
The Windows CE Utilities for Visual Studio .NET 2003 enables developers to deploy and debug managed code applications for Windows CE platforms.
In order to install the Windows CE Utilities for Visual Studio .NET 2003, Visual Studio .NET 2003 must be installed on your computer.
For detailed information about deploying and debugging an application using the Windows CE Utilities for Visual Studio .NET 2003, see the following frequently asked questions.
What does my device require to debug with Visual Studio?
How do I deploy and debug my application on a device running Windows CE with ActiveSync?
How do I deploy and debug my application on a device running Windows CE with TCP/IP support?
How do I debug my application on an x86-based device running Windows CE?
I have a problem debugging on a device with flash memory. How do I fix this?
How do I deploy my application when I have more than 50 network protocols installed on my computer?
I get an error about a
missing skin file when opening an SDK emulator. How do I fix it?
What does my
device require to debug with Visual Studio?
If you are having problems debugging on your device with Visual Studio, make sure that you have the following items.
· A device with ActiveSync or an Ethernet connection
Visual Studio can use either of these to remotely connect with the device.
· The file WCELOAD on the device.
This is required to install the .NET Compact Framework and other dependant modules on the device. In Platform Builder it is part of the CAB File Installer/Uninstaller component.
Note The CAB File
Installer/Uninstaller component is located in the catalog in Core
OS\Display Based Devices\Applications and Services Development\Applications–End
User\.
· The file Toolhelp.dll on the device.
This module is used by the debugger and required on the device.
To copy Toolhelp.dll to the device
1. Open the folder that corresponds to the CPU of your device in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\Toolhelp\WinCE410.
2. Copy Toolhelp.dll to the \Windows folder of the device.
How do I
deploy and debug my application on a device running Windows CE with ActiveSync?
The following procedure details how to set up a Visual Studio .NET 2003 development environment for creating, debugging and deploying a managed code application on a custom Microsoft® Windows® CE .NET device that is ActiveSync enabled.
Requirements
· Visual Studio .NET 2003
· Windows CE Utilities for Visual Studio .NET 2003
· Windows CE .NET 4.1 or Windows CE .NET 4.2 based device
· ActiveSync components (Repllog.exe, Rapisrv.exe) installed on the device*
· CAB File Installer/Uninstaller (WCELoad.exe) installed on the device*
· ToolHelp.dll installed on the device
· ActiveSync installed on the desktop
Note: ActiveSync 3.5 is recommended if you are using Windows CE .NET 4.1.
· RS232/USB 115k serial connection
To use the Select Windows CE Device CPU utility
1. Open a new or saved Smart Device project in Visual Studio .NET.
2. For an x86 device, import the file WinCEx86Device.reg on your workstation that on which you installed VS .NET 2003 and the Windows CE Utilities for Visual Studio .NET 2003.
3. Make an ActiveSync connection between your device and desktop machine by running Repllog.exe on your device.
4. On the Tools menu, click Select Windows CE Device CPU.
5. Select the CPU of your target device from the drop-down box, and click Configure.
Note If you select ARMV4I, the tool will automatically convert it to ARMV4T because Visual Studio .NET 2003 treats ARMV4I devices as ARMV4T.
6. Click Close.
7. Restart Visual Studio to apply the new settings.
You can now create, debug and deploy managed code applications for Windows CE .NET platforms using Visual Studio .NET 2003.
How do I
deploy and debug my application on a device running Windows CE with TCP/IP
support?
The following procedure details how to set up a Visual Studio .NET 2003 development environment for creating, debugging and deploying a managed code application on a custom Microsoft® Windows® CE .NET device that is not ActiveSync enabled.
Requirements
· Visual Studio .NET 2003
· Windows CE Utilities for Visual Studio .NET 2003
· Windows CE .NET 4.1 or Windows CE .NET 4.2
· LAN/WLAN networking components on the device*
· CAB File Installer/Uninstaller (WCELoad.exe) on the device*
· Toolhelp.dll on the device
· SDAuthUtilDevice.exe on the device, included in the Windows CE Utilities for Visual Studio .NET 2003
· Ethernet connection
To use the Smart Device Authentication Utility
1. Open a new or saved Smart Device project in Visual Studio .NET.
2. Run the Smart Device Authentication Utility on the device.
To run the Smart Device Authentication Utility on the device
a. Open the folder that corresponds to the Windows CE version on your device in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\Authentication Util.
b. Open the folder that corresponds to the CPU of your device.
c. Copy the file SDAuthUtilDevice.exe to your device.
d. Run SDAuthUtilDevice.exe on your device.
e. Click Start.
Note: There will be a pause while the workstation running Visual Studio .NET connects to the device via a TCP/IP connection.
3. Run the Smart Device Authentication Utility on the computer running Visual Studio .NET.
To run the Smart Device Authentication Utility on the computer
a. On the Tools menu, click Smart Device Authentication Utility.
b. In the Device IP address box, enter the IP address of the device.
c. Click Set Up Device.
4. Apply the new setting to Visual Studio as described in the following procedure.
To apply the settings to Visual Studio
a. On the Tools menu, click Options.
b. Click Device Tools and then click Devices.
c. In the Show devices for platform box, click the device that you want to connect to.
d. Click Save As, type a new name in the box, and click OK.
e. In the Transport box, click TCP Connect Transport.
f. Click Configure.
g. Click Use specific IP address, and enter the device's IP address.
h. Click OK.
You can now create, debug and deploy
managed code applications for Windows CE .NET platforms using Visual Studio
.NET 2003.
How do I debug
my application on an x86-based device running Windows CE?
Issue: After running the Windows CE Device Configuration Add-In, the user can deploy
without debugging to an x86-based device running Windows CE connected to the
desktop computer through ActiveSync.
Solution: Modify the registry on the desktop computer running Visual Studio to allow debugging on x86-based devices running Windows CE. This will disable debugging on the Windows CE emulator until the registry is restored.
To enable debugging on x86-based devices running Windows CE
·
On the
desktop computer running Visual Studio, import WinCEx86Device.reg to the
registry.
Note WinCEx86Device.reg is located by default in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\WinCE Proxy Ports Reg.
To restore debugging on the Windows CE emulator
1.
Remove the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
CE Services\ProxyPorts.
2.
On the desktop computer running Visual Studio, import
ProxyPorts.reg. to the registry.
Note ProxyPorts.reg
is located by default in Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\WinCE Utilities\WinCE Proxy Ports Reg.
I
uninstalled ActiveSync and then reinstalled it. Now I can’t deploy my
application. How do I fix this?
Issue: After uninstalling ActiveSync version 3.5, 3.6, 3.7 or 3.71,
deploying fails with the error message "There were deployment
errors. Continue?” This typically happens when one version of ActiveSync is
uninstalled and a newer version is installed.
Solution: Uninstalling these versions of ActiveSync removes some registry settings that are required for deployment. You must restore these registry settings to enable deployment.
To restore the registry settings
1.
Import ProxyPorts.reg. to the registry.
Note ProxyPorts.reg is located by default in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\WinCE Proxy Ports Reg.
2.
Remove the
device from the cradle and replace it. If deployment still does not work, soft-reboot
the device.
I have a problem debugging on a device with flash memory. How do I fix this?
Issue: Deployment does not work
with some devices running Windows CE 4.1 that are equipped with certain types
of flash memory.
Solution: Some keys are partially stored in the
device's file system and partially in the flash memory. When the device is
reset, half the key is deleted, and the key is perceived as corrupt. Run
DelCryptoKeys.exe to delete any corrupt keys stored on the device.
To run DelCryptoKeys.exe
1. Open the folder that corresponds to the CPU of your device in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\DelCryptoKey.
2. Copy DelCryptoKeys.exe to the device.
3. Run DelCryptoKeys.exe.
DelCryptoKeys.exe
can be run in the following modes.
Usage |
Output |
DelCryptoKeys |
Runs with no output. |
DelCryptoKeys /out:UI |
Displays results in a message box. |
DelCryptoKeys /out:filename |
Saves results in the file filename. |
The following error codes are returned if there is a problem running the tool.
Error Code |
Meaning |
2 |
The key was not found. It may have already been deleted or was never a problem. |
5 |
Deployment has already been performed. Restart the device and try again. |
How do I
deploy my application when I have more than 50 network protocols installed on
my computer?
Issue: A computer running more than
50 network protocols cannot deploy to a device. An attempt to deploy results in
the error message “There were deployment errors. Continue?”
Solution: You can either remove any network protocols that are not needed or uninstall any applications that have installed protocols.
To remove network protocols
1. Click Start, and then click Control Panel.
2. Double-click Administrative Tools, and then double-click Computer Management.
3. Under System Tools, click Device Manager.
4. In the right pane, expand Network Adapters.
5. Remove any unused network adapters
To uninstall applications with installed protocols
1. Run EnumProtocols.exe to see which applications have installed protocols.
Note EnumProtocols.exe is located by default in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\EnumProtocols.
2. Uninstall any unnecessary applications.
I get a device connection error when deploying or debugging, but other logon users on the same computer can connect to the same device with Visual Studio .NET. How do I fix this?
Issue: Deployment
to a Pocket PC or Windows CE device connected with ActiveSync fails with the
error message “Could not establish a connection with the device. Please make
sure the device is connected and working properly.” Other logon users on the
same computer may be able to deploy and debug using the same device, ActiveSync
is working correctly, and the file \Windows\ConManClient.exe is not copied to
the device when attempting to deploy or debug.
Solution: These symptoms indicate a possible corrupted security key container. On the computer running Visual Studio .NET, run DelDesktopCryptKey.exe from the command prompt to clean the security key container for the current user.
Note DelDesktopCryptKey.exe is located by default in Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\WinCE Utilities\DelDesktopCryptKey.
I get an error about a missing skin file when opening an SDK emulator. How do I fix it?
Issue: If you install an emulator with an SDK built by Platform Builder, starting the emulator from Visual Studio .NET 2003 may produce the following message:
The specified XML Skin file could not be opened. Please verify that the specified filename or path is valid.
Solution:
You can either fix the error manually or run the DelEmuSkin utility to create a
new Windows Installer (.msi) file for the SDK.
To fix the error manually
1.
Open the
registry and locate registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
CE Tools\Managed Platforms.
The Managed Platforms
registry key should contain one or more subkeys identified with GUIDs.
Each subkey represents a distinct emulator installed by an SDK and should have
values for PlatformName, Skins,
and so forth. Locate the emulators that produce the skin error. The Skins value in the registry for those emulators should be a
folder name. Set the registry value of Skins to the
full path of the skin’s XML file.
2. Delete
the file sdkRollerDevice-<GUID> for every emulator that produces
an error, where <GUID> corresponds to the GUID for that
emulator.
Note The
sdkRollerDevice-<GUID>
file is located by default in Documents and Settings\All Users\Application
Data\Microsoft\VisualStudio\devices\addons.
You can now start Visual Studio .NET 2003 and use the
emulators.
Using the DelEmuSkin utility removes all skins from the emulators. While this may seem to be a drawback, this utility does make it easier and safer to correct the skin file error by eliminating the need for manual registry changes or file deletion. In addition, the DelEmuSkin utility generates a new .msi file that can be distributed to others for SDK installation.
To use the DelEmuSkin
utility
1.
Run DelEmuSkin.exe.
Syntax
DelEmuSkin OldFileName NewFileName |
Parameter |
Description |
OldFileName |
The original .msi file for the SDK. |
NewFileName |
The name to save the new .msi file as. |
Note DelEmuSkin.exe
is located by default in \Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\WinCE Utilities\DelEmuSkin\.
2. If
the SDK is installed, remove it through the Add/Remove Programs option in Control Panel.
3. Start
Visual Studio .NET 2003 and open a smart device project. Confirm that the
emulators installed by the SDK are no longer in the device list.
4. Install
the SDK with the .msi file generated by DelEmuSkin.
You can now start Visual Studio .NET 2003 and use the
emulators.