问题
I'm developing a Windows Mobile app using the .NET Compact Framework 3.5 and VS2008, and for debugging using the Device Emulator V3, on Win7, and seem to have constant problems with Windows Mobile Device Centre (6.1) connecting.
Using the Emulator Manager (9.0.21022.8) I cradle the device using DMA in WMDC. The problem is it's so flaky at actually connecting that it's becoming a pain.
I find that when I turn my computer on, before I can get it to connect I have to open up WMDC, disable Connect over DMA, close WMDC down, reopen it again, and then it might cradle. Often I have to do this twice before it will cradle.
Once it's cradled it's generally fine, but nothing seems consistent in getting it to connect.
Connecting with physical devices is often better, although not always. If I plug a PDA into a USB socket other than the one it was originally plugged into then it won't connect at all. Often the best/most reliable connection method seems to be over Bluetooth, but that's quite slow.
Anybody got any tips or advice?
回答1:
I thought I'd add some notes to this so I could close it off. Generally I found not the following to make it a little more stable:
1) Don't setup a partnership. While this doesn't provide a major issue, if there is a partnership in place, a blank dialog window pops up whenever I connect a device.
2) Always make sure you connect the device (via USB) to the same USB port that it was first on when the device driver was first installed. Moving the lead to a different port will often cause the device to not connect.
3) If it doesn't connect then opening WMDC and un-ticking allow DMA connections, close the WMDC screen, re-open it and re-tick the DMA option, and it will generally suddenly connect.
4) Also if you're using the device emulator and have it cradled, ensure you disconnect the ActiveSync connection before saving the state of the device when closing it. If you fail to do this it will no be able to connect when you restart the device, until you fiddle about with the connection enough for it to realise that it's not actually connected.
If anybody else has any tips to making it more stable then feel free to add them in.
回答2:
Try deleting the existing device partnerships. That has helped me in the past when WMDC/ActiveSync was playing up.
Go to Control Panel -> Sync Center and delete the device partnerships you see listed there. Then reconnect your device/emulator and when the WMDC window comes up, make sure you create a new device partnership (in my experience the connection/debugging becomes flakier when you choose to not setup a partnership).
回答3:
Another thing to point out about ActiveSync, I learnt this the hard way, I noticed the battery drains faster with ActiveSync, even if it is not in the cradle, it is actually running in the background, and whether it is a bug or not, not sure, but, it 'thinks' it is still in the cradle and continuously polling for the connection. Here's the link that explains it. And here's the temporary fix.
The way I dealt with it is to run a small C program that looks for the ActiveSync process and kill it each time I un-cradle the pocketpc.
来源:https://stackoverflow.com/questions/2127666/why-is-wmdc-activesync-so-flaky