【问题标题】:Debugging Windows CE Device from Windows 10 with Visual Studio 2008使用 Visual Studio 2008 从 Windows 10 调试 Windows CE 设备
【发布时间】:2016-03-18 15:18:15
【问题描述】:
本周我从 Windows 7 升级到了 Windows 10。我为移动设备(例如 Windows CE7、Windows Mobile)开发紧凑型框架软件。我使用 Visual Studio 2008。
现在我收到错误消息:“连接到设备时出错”(设备连接组件)。
Windows Mobile 设备中心正在运行,并且该设备显示在我的资源管理器中。
有什么提示吗?
【问题讨论】:
-
Microsoft Connect 有一个线程,提供了一些解决方法。如果您仍在为 Win CE/Win Mobile(不是“Windows 10 Mobile”)开发,那么您应该坚持使用 Windows 7。
标签:
visual-studio-2008
compact-framework
windows-10
mobile-devices
【解决方案1】:
我不记得我在哪里得到了这个 WMDC_Service_Fix.bat 文件,但它为我修复了在 Windows 10 中与设备的连接。
这是批处理文件的内容,只需重新创建并运行它:
@echo off
::WcesComm is the name of the "Windows Mobile-2003-based device connectivity" service.
::RapiMgr is the name of the "Windows Mobile-based device connectivity" service.
::Both being necessary for proper WMDC functionality.
::The following registry entires set the RapiMgr and WcesComm services to run as seperate processes
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\RapiMgr /v SvcHostSplitDisable /t REG_DWORD /d 1 /f > nul 2>&1
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\WcesComm /v SvcHostSplitDisable /t REG_DWORD /d 1 /f > nul 2>&1
if %errorLevel% == 0 (
echo Service Registry entries added successfully
) else (
echo Failure: Please run this file as admin.
goto end_Pause
)
::Set the compatability of wmdc.exe to Windows Vista (which works more consistently)
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\WindowsMobile\wmdc.exe" /d "~ VISTARTM" /f > nul 2>&1
if %errorLevel% == 0 (
echo Compatability Mode for WMDC successfully set
) else (
echo Failure: Please manually set the compatibility mode for
echo C:\Windows\WindowsMobile\wmdc.exe
echo to "Vista" for all users.
)
echo.
::Stop both the services associated with WMDC
net stop WcesComm
net stop RapiMgr
::Set both the services to run as LocalSystem
sc config WcesComm obj= LocalSystem password= "" > nul 2>&1
sc config RapiMgr obj= LocalSystem password= "" > nul 2>&1
if %errorLevel% == 0 (
echo Services configured to Log in As LocalSystem
) else (
echo Failure: Services could not be updated
)
echo.
::Restart the services. Starting WCesComm also starts RapiMgr
net start WcesComm
:end_Pause
pause
在设备上调试时我使用Windows CE Device 选项(Zebra MC2100 with Windows CE 6.0):
我还使用了一个方便的小工具,名为 Remote Display Control for Windows CE 或 CERDisp。在这里获取它https://forums.ivanti.com/s/article/CERDisp-Display-and-control-your-Windows-CE-device-from-your-desktop
【解决方案2】:
我发现了我的问题:
在 Visual Studio 2008 中,您可以在“Windows Mobile 5.0 Pocket PC Device”和“Windows Mobile 5.0 Pocket PC Device R2”之间进行选择
我必须选择“R2”,然后它对我有用。
【解决方案3】:
如果它对其他人有帮助,我在 Windows 10 上使用 Visual Studio 2008 并尝试连接到 Windows CE 5.0 设备并且遇到了同样的问题。
Win 10 检测到该设备,我可以从我的 PC 等浏览它的文件系统,但 VS2008 无法连接并显示一条消息:
ActiveSync 引导程序初始化失败。请连接/摇篮
真实设备或下载用户级 Windows Mobile 设备中心
来自...的申请
最后我通过手动安装Windows Mobile Device Center 6.1 让它工作了(还有一个32 bit version)