用.net 2003作Windows CE應用時,碰到一個問題。工程編譯通過,但在部署到pocket pc時出現如下的錯誤:
------ 已啟動部署: 項目: PDA, 配置: Debug Pocket PC ------
正在部署到 Pocket PC 裝置正在使用 TCP 串連傳輸
錯誤: 無法建立串連。請確保此裝置已經與開發電腦建立了物理串連。
---------------------- 完成 ---------------------
產生: 1 已成功, 0 已失敗, 0 已跳過
部署: 0 已成功, 1 已失敗, 0 已跳過
感覺很奇怪,我明明用ActiveSync是可以連上的。到msdn上搜了一下(http://support.microsoft.com/default.aspx?scid=kb;en-us;816826)
原文如下:
Certain users on the desktop computer may notice that the deployment to a Pocket PC device that is connected with ActiveSync is not successful and you receive the following error message:
Could not establish a connection with the device. Please make sure the device is connected and working properly.
Other users on the same computer may be able to deploy and to debug by using the same device, may find that ActiveSync is working correctly, and may find that the file WindowsConManClient.exe is not copied to the device when they try to deploy or to debug. These symptoms indicate a possible corrupted security key container.
On the computer that is running Visual Studio .NET, run the DelDesktopCryptKey.exe utility from the command prompt to clean the security key container for the current user. DelDesktopCryptKey.exe is installed with the Windows CE Utilities for Visual Studio .NET 2003 Add-on Pack. By default, DelDesktopCryptKey.exe is located in the Program FilesMicrosoft Visual Studio .NET 2003CompactFrameworkSDKWinCE UtilitiesDelDesktopCryptKey folder.
原來是由於security key container到期了,安裝Windows CE Utilities for Visual Studio .NET 2003 Add-on package 後,在命令列中到Program FilesMicrosoft Visual Studio .NET 2003CompactFrameworkSDKWinCE UtilitiesDelDesktopCryptKey目錄下運行DelDesktopCryptKey.exe,然後在重啟一下電腦,問題解決。