locked
Connect to Device Failed. Visual Studio 2008 RRS feed

  • Question

  • Hello,
     
    I'm trying to Deploy a SmartDevice Application written in C# to a Windows CE Device.
     
    During the deployment I get: (After very long time)
     
    All attempts to connect to the deployment target at port 5655 have failed. Addresses attempted:
     
    192.168.0.103;fe80::260:b3ff:fe11:f65b%13;fe80::5efe:192.168.0.103%2;127.0.0.1.
     
    The device security configuration may have disallowed the connection. Ensure that you have the appropriate certificates on your device for development. Review your SDK documentation for proper security settings for connecting to this device.
     
    The problem is that it already worked for me. It stopped working few days ago. I never had to install any certificates on the device.
    I'm using Windows Vista Home Premium SP2 And Visual Studio 2008 Professional Edition version 9.0.30729.1 SP
    Device is Datalogic memor connected via USB cable.
    I never touched any configuration so it is set as default: (I mean settings in Options -> Device Tools -> Devices -> Windows CE Device -> Properties)
    Transport: TCP Connect Transport (Obtain an IP Address automatically using Active Sync)
     

    What I have figured out:
     
    Since I'm using WIndows Vista I don't have Active Sync, but instead I have Windows Mobile Device Center (for which I have downloaded all upgrades through WIndows Update).
    I can use Windows Mobile Device Center to connect to device, browse files, synchronize, etc. I can also use simple Windows Explorer to copy files to device without any problems.

    Device displays that the usb connection is in connected state but ip config is displaying the following ip address:
    192.168.55.101 (which is not in my local subnet)
     
    From the output of Visual Studio we can see that it is trying to connect to device using TCP and ip: 192.168.0.103. (Which is in my local subnet, but is of course not the correct ip address of the device.)
     
    Why the device has IP address associated with USB cable? Why Visual Studio is trying to reach device using TCP/IP instead of USB Cable? Who is responsible for giving the correct IP address to a device? How can I select the port on which the device is listening? How can I make sure that the Windows CE Device is listening on port  5655 (which is used by Visual Studio to connect to device)?
     
    I'd like to add that deploying applications on emulators works for me. Of course I have no firewalls and my Windows Firewall was first thing I disabled after having connectivity troubles.
     
    Please help...

     

    Sunday, May 8, 2011 4:53 PM

Answers

  • Finally I have solved the issue.

    I should have thought about it from the begining.

    I took the battery out from the device. Then I put it again.

     

    Anyway, it looks like I had some application running on device that was blocking the VS from running. It was probably my fault as I tempered with device, running there some ConMan2.exe and similar application when trying to resolve connection issues.

    So there were probably 2 problems. One created by myself, and the other was solved by one of steps I did before. Unfortunately I have no idea which one. :(

    Thanks for your help anyway!

    • Marked as answer by DeeJay507 Sunday, June 12, 2011 5:52 PM
    Sunday, June 12, 2011 5:52 PM

All replies

  • ActiveSync/WMDC always use TCP/IP even over USB connections. (They just use USB as the Network layer and assign 192.168.55.101 to the device).

    Verify your device appears under "My Computer" when connected by USB.

    Under Device Tools->Devices pick your device from the list and click Properties. Under the Transport label, click Configure.  Uncheck Used fixed port number.

    Now, try to connect with your device using the USB cable.

    If you want to debug over an Ethernet or WiFi connection rather than USB, see: http://msdn.microsoft.com/en-us/library/ms228708%28v=vs.80%29.aspx

    -PaulH


    Monday, May 9, 2011 2:41 PM
  • Thanks for answer.
     
    Indeed, my device appears under "My Computer" when connected by USB. I can access it with Windows Explorer and copy some files to and from device.
     
    Under Device Tools -> Devices I've picked Windows CE Device and under its properties I have set TCP Transport which is confugured (and always was configured) in the way you described. Used fixed port number is UNCHECKED and "Obtain an IP address automatically using ActiveSync" is selected.
     
    However I still get the same error "Connect to device failed".
     
    All attempts to connect to the deployment target at port 5655 have failed. Addresses attempted:
    192.168.0.103;fe80::260:b3ff:fe11:f65b%13;fe80::5efe:192.168.0.103%2;127.0.0.1.
      
    So as you can see, even with used fixed port number unchecked it always tries the same port. Where it gets the IP Addresses from is a mystery for me.
     
    There are 2 possibilities I see:
     
    1) When I click "Use specific IP Address" i have a combo box which I can drop down. There I have 4 IP Addresses (Previous attempts to fix the problem). These are: 127.0.0.1, 192.168.0.103, 222.222.222.222, 192.168.55.101. Maybe VS is trying to to get all the once entered IP Addresses that are in my subnet? We can also see that 192.168.0.103 is attempted twice. hmm...
     
    2) Maybe Visual Studio is obtaining the MAC Address from ActiveSync/WMDC and tries to ask my router about IP Address. My router remembers the 192.168.0.103 because I had connected my device by Wi-Fi some days ago.
     
    The question remains:
     
    Why Visual Studio is not trying to connect using 192.168.55.101?
     
    What can I do to fix it? Reset the DHCP Table in Router? Uninstall Visual Studio and Install it again? Format my C: drive? Help...
     

    Monday, May 9, 2011 4:59 PM
  • If the device shows up in Windows Explorer and you can browse the files, then the WMDC connection isn't the issue. It's something to do with Visual Studio.

    Have you tried restarting VS and rebooting your PC?

    What version of Windows CE is your device running?

    You can try the steps listed in this troubleshooting guide: http://www.microsoft.com/windowsphone/en-us/howto/wp6/sync/activesync-troubleshooting.aspx

    -PaulH

    • Proposed as answer by Jesse Jiang Tuesday, May 17, 2011 7:54 AM
    Tuesday, May 10, 2011 3:36 PM
  • Hi,

     

    I'm very interested in hearing more about your issue, did you solve your problem?

    If so please share the solution with us and mark the right answers.

    If not please let me know and I will tray to help you find further solutions.

     

    Have a nice day!

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 17, 2011 7:53 AM
  • Sorry,

     

    I had no time recently to play with this issue.

    Of course I tried to restart Visual Studio and reboot my PC. I even tried to launch repair on my Visual Studio. It didn't help.

    My Device is running Windows CE version 5.00

    Steps listed in the troubleshooting guide:

    I disabled firewall of course -> no help at all.

    I don't use network connection managers (I have plain windows vista)

    I don't have any VPN clients

    I don't have any parential control utilities

    I'm not using any docking station or don't have USB Hub, just normal destkop PC.

    I don't have any network traffic optimizers

    My DHCP Client is ON

    Other things are hard to follow since they require WIndows Phone 6.5 and I have Windows CE Device and have different options.

    Anyway, my connection from Windows Mobile Device Center to my Windows CE Device is working. As I said I can browse files, copy them to and from device, configure synchronization of pictures from the device, etc. It is just Visual Studio that can't connect.

    I plan to reinstall the Visual Studio later, but if there is an easier solution it would be great to hear about it.

    Tuesday, May 17, 2011 9:28 PM
  • Hi, I have not solved it yet :(
    Tuesday, May 17, 2011 9:29 PM
  • Hi,

     

    I hope you can check the connect settings in Visual Studio.

     

    Tools-> Options->Device Tools->Devices-> select your device and click Properties

     

    You can see that the Visual Studio will need TCP to transport, and then you can click Configure to configure this transport.

     

    You can set the port number or specific IP address. However, I suggest you to select Obtain an IP address automatically using ActiveSync.

     

    I hope my suggestions can help you to solve this problem.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 18, 2011 9:25 AM
  • Hi Jesse,

    I know there is right now a lot of text to read in this thread, but I already stated twice that I tried to do everything with these settings including selecting Obain an IP address automatically using ActiveSync and typing in IP Address manually. These settings do not affect anything. I still can't make Visual Studio to connect to device.

    What I will try now is to uninstall Visual Studio and install it again.

    Wednesday, May 18, 2011 5:39 PM
  • Hello,

     

    How about the issue now, did you not solve it yet, after reinstall the Visual Studio?

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 23, 2011 12:43 PM
  • Hi there,

     

    I have the very same problem. Everything worked just fine until yesterday. 

    Today I even reinstalled Visual Studio 2008 but I still can't connect to my device. Active sync (Windows Mobile Device Center) works just fine. I can browse the files on my device but there is no way I can connect to my device from Visual Studio 2008.

     

    I'm looking forward to hear what your future experiences will be.

    Wednesday, May 25, 2011 2:23 PM
  • Hello,

     

    I also reinstalled Visual Studio 2008 and it did not help. I have exactly same issue.

    What I think right now is that there is some system COM/COM+ component called CoreConnectivity that allows for remote access and debugging inside Mobile Devices. I think that Visual Studio is using this and since this component configuration is probably broken on my machine I have problems.

    What I have found out is here:

    http://msdn.microsoft.com/en-us/library/ms893217.aspx

     

    Under C:\Users\<my user name>\AppData\Local\Microsoft\CoreCon\1.0 there are some XSL files with some interesting stuff.

    When I delete these files, and then press connect in Visual Studio these files appear again. There must be some other place where default settings are kept. For the moment I though that I have some problem in this user-specific config and if I delete the files, default will be restored and everything will work fine. Unfortunately that was not true :(

     

    Anyone knows what are these files? How can I track the problem down? Since it seems like Visual Studio 2008 is trying to connect to my device using some 192.168.0.3 IP Address, but where this address comes from? It is certainly wrong. My Device doesn't have such address. I think I need to find out where that address is stored and either delete it or replace it with correct one?

     

    Wednesday, May 25, 2011 5:20 PM
  • Hi,

     

    I think the IP is I mention before. You can special it. For that files, I do not think they are the configure files.  I guess maybe some system incompatible issue caused this problem.

     

    You can run Visual Studio with safe mode and restore all the settings of Visual Studio and try again. Please follow these links:

     

    Devenv Command Line Switches

    /SafeMode (devenv.exe)

     

    How to: Reset Your Settings

     

    And you should make sure following things:

    1. The IP port does not be occupy by other application
    1. If you want to debug the real device, you need to install the device's SDK

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Jesse Jiang Monday, May 30, 2011 8:18 AM
    • Marked as answer by Jesse Jiang Wednesday, June 1, 2011 8:13 AM
    • Unmarked as answer by DeeJay507 Sunday, June 12, 2011 10:03 AM
    • Unproposed as answer by DeeJay507 Sunday, June 12, 2011 10:08 AM
    Thursday, May 26, 2011 7:40 AM
  • Hi,

     

    I marked my reply as answer, if your issue have not been solved please unmark it and update more information about this issue.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 1, 2011 8:14 AM
  • Hello,
     
    Sorry for a long break, I had no time to bother with this issue :(
     
    Anyway, I tried your solutions: Reset the devenv.exe settings, tried running in safe mode. I alwyas get the same message:
     
    "All attempts to connect to the deployment target at port 5655 have failed. Addresses attempted:
     
     
     
    192.168.0.103;fe80::260:b3ff:fe11:f65b%13;fe80::5efe:192.168.0.103%2;127.0.0.1.
     
     
     
    The device security configuration may have disallowed the connection. Ensure that you have the appropriate certificates on your device for development. Review your SDK documentation for proper security settings for connecting to this device.
     
     
     
    Connect to device failed."
     
    Ad1) I have launched netstat -a -b and have svchost.exe listening at 127.0.0.1:5655, But I guess that is ok?
     
    Ad2) I never installed the device's SDK and debugging was already working for me. Anyway I downloaded and installed it now. It didn't help.
     
    Sunday, June 12, 2011 10:07 AM
  • Finally I have solved the issue.

    I should have thought about it from the begining.

    I took the battery out from the device. Then I put it again.

     

    Anyway, it looks like I had some application running on device that was blocking the VS from running. It was probably my fault as I tempered with device, running there some ConMan2.exe and similar application when trying to resolve connection issues.

    So there were probably 2 problems. One created by myself, and the other was solved by one of steps I did before. Unfortunately I have no idea which one. :(

    Thanks for your help anyway!

    • Marked as answer by DeeJay507 Sunday, June 12, 2011 5:52 PM
    Sunday, June 12, 2011 5:52 PM