Visual Studio 2005 The remote connection to the device has been lost. Please verify the device connection and restart debugg

Basically I've been using Visual Studio 2005 for a few weeks now moving a Pocket PC project from 2003 to 2005. When I hit the Start Debugging Button every time until today the project would rebuild and deploy to my pocket PC allowing me to debug etc but now I get

The remote connection to the device has been lost.

Please verify the device conection and restart debugging.

I used to get this problem in VS2003 sometimes and just like the numerous posts on different sites that I've looked at the problem eventually goes away and I'm none the wiser. One guy said that he found that if he went to bed the problem was resolved when he came back!

My PDA running Windows 2003 2nd Edition is directly connected to my PC via a USB port. I've rebooted my PC and done a soft reset on the PDA but it didn't help. I'm using ActiveSync 4.1.

Does anyone know how to resolve this problem



Answer this question

Visual Studio 2005 The remote connection to the device has been lost. Please verify the device connection and restart debugg

  • Harkernator

    The problem came back. This time I deleted all my break points and closed down visual studio. I then went back in, opened the solution and put a break point in. It worked straightaway! The break point was hit and I didn't get the message. Whoooppeeeeeeeee


  • ehsan sadeghi

    My project is currently working fine. When I get this problem again (as I'm sure I will) I'll try what you say RaguV. Thanks.

    I'm not using the emulator though. So I'll try changing my deployment options to use the emulator and when that fails I'll switch back to deploying straight to my device.


  • LAPM

    I still can't debug. I have just tried a hard reset and I get the same problem

    The build output is as follows

    ------ Build started: Project: BO, Configuration: Debug Any CPU ------

    BO -> C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\BO\bin\Debug\BO.dll

    ------ Build started: Project: Printing, Configuration: Debug Any CPU ------

    No way to resolve conflict between "System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes" and "System.Data.SqlServerCe, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes". Choosing "System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes" arbitrarily.

    Printing -> C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\Printing\bin\Debug\Printing.dll

    ------ Build started: Project: MobileSeller, Configuration: Debug Any CPU ------

    Consider app.config remapping of assembly "System.Data, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "1.0.5000.0" [] to Version "2.0.0.0" [C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Data.dll] to solve conflict and get rid of warning.

    Consider app.config remapping of assembly "System.Windows.Forms, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "1.0.5000.0" [] to Version "2.0.0.0" [C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Windows.Forms.dll] to solve conflict and get rid of warning.

    Consider app.config remapping of assembly "System, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "1.0.5000.0" [] to Version "2.0.0.0" [C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.dll] to solve conflict and get rid of warning.

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.

    MobileSeller -> C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\bin\Debug\MobileSeller.exe

    Done building project "MobileSeller.vbproj".

    ------ Skipped Deploy: Project: BO, Configuration: Debug Any CPU ------

    Project not selected to build for this solution configuration

    ------ Skipped Deploy: Project: Printing, Configuration: Debug Any CPU ------

    Project not selected to build for this solution configuration

    ------ Deploy started: Project: MobileSeller, Configuration: Debug Any CPU ------

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\windowsce\wce400\armv4\NETCFV2.ppc.armv4.cab'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\BO\bin\Debug\System.Data.Common.dll'

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v2.0\wce400\ARMV4\sqlce20.ppc.wce4.armv4.CAB'

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v2.0\wce400\ARMV4\sqlce20.dev.ppc.wce4.armv4.cab'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\BO\bin\Debug\InTheHand.Data.Adoce.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\BO\bin\Debug\InTheHand.Interop.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\Printing\bin\Debug\PocketHTMLprint_NetCF.dll'

    Deploying 'C:\Dev\MILLAR CODE CABINET\VS2003CF\References\USICF.dll'

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\wce400\ARMV4\sqlce30.ppc.wce4.armv4.CAB'

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\wce400\ARMV4\sqlce30.repl.ppc.wce4.armv4.CAB'

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\wce400\ARMV4\sqlce30.dev.enu.ppc.wce4.armv4.CAB'

    Deploying 'C:\Dev\VS2005CF\References\release\Signature.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\RealUpDown.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\Printing\bin\Debug\Printing.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\PhoneAPI.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\MVnetApplication.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\MobileHList.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\MobileGrid.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\ImageButtons.dll'

    Deploying 'C:\Dev\VS2005CF\References\release\CreditCardValidator.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\BO\bin\Debug\BO.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\View.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Unscheduled.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Unschedule.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\tr.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\top.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Tools.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\tl.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\SmlButUnPressed.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\SmlButSquUnPressed.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\SmlButSquPressed.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\SmlButPressed.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Select1.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\sekonda3.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\sekonda2.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\sekonda1.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\ScrewDriver.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Scheduled.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Scheduled.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Schedule.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Scan.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Save.ICO'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Remove.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\ReceiptTemplate.htm'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Problem.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\PrintDC.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Print.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Prev.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\bin\Debug\PocketHTMLprint_NetCF.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\pocketHTMLprint.dll'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Phone.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Page.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\NotesExist.ICO'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Notes.ICO'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Next.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\NewCust.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\MVNetLogoSmall.png'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\mtiny.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\MoneyScrew.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Money.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Magnify.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Lock.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Line.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\InvoiceTemplate.htm'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\gradus4.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\gradus3.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\gradus2.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\gradus1.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\FindVisit.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\FindCustomer.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Find.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\DropDown.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\dentsplus3.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\dentsplus2.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\dentsplus1.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\DentDevilsCar.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\DentDevils2.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\DentDevils1.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Default2.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Default1.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Cust.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Completed.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Cancelled.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\Call.ico'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\br.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\bottom.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\bl.gif'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\BigButUnPressed.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\Resources\BigButPressed.jpg'

    Deploying 'C:\Dev\millar\MobileSeller\code\2005\MobileSeller\MobileSeller\MobileSeller\bin\Debug\MobileSeller.exe'

    Deploying 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\windowsce\diagnostics\System_SR_enu.cab'

    ========== Build: 3 succeeded or up-to-date, 0 failed, 0 skipped ==========

    ========== Deploy: 1 succeeded, 0 failed, 2 skipped ==========

    Visual studio indicates that

    Deployment Started

    Depolyment Succeeded

    Loading Symbols

    Ready

    and then I get the same problem ie The Remote connection to the device has been lost


  • Jarda Jirava

    It's broken again i.e. I'm getting the same problem.

    My project target device is set to Pocket PC 2003 Device and so after first getting the 'The remote connection ...' message I changed the target device to Pocket PC 2003 SE Emulator and ran the project. I got the same message in this mode. I then closed the emulator (not saving the state), reset the target device to Pocket PC 2003 Device and then ran again. The problem still occurred ... so I'm none the wiser.


  • enric vives

    I definitely do not understand why this happens... In fact just wasted half day in drilling this... But then i have a crazy easy solution for it...

    Just keep the emulator that you are using as it is, but when you start you app in debug mode select a different emulator in the deployment options. This will open the other emulator automatically and that will also fail... and then close the newly opened emulator and start the application with debugging and this time select the correct emulator that you are using. It will work, it did work couple of times in two different laptops. May not make any sense to any one but neither to me as well... ;-)


  • EsteemDE

    I am having the same problem. In the first line of my code, it calls a function from a library I made. Before I added the call to that function, the program ran fine, but now when I start the debugger, I get the same message as Jim where the remote conneciton is lost. I tried commenting out that line of code, and then it runs fine. I then tried copying the code from that function and putting it in my main function and that also runs fine, even though within that code it makes a call to a different function within the same class from that library I made. One thing that I have in common with Jim is that I am also doing SQL Server replication within my code. I have VS set to use a Pocket PC 2003 device wich I have plugged in to the PC using a USB cradle. When I try to use the Pocket PC 2003 SE Emulator, I get the same problem.

  • yxrkt

    I forgot to say that the app is using SQLServer replication.

    I also tried to put a break point in my sub main (first line) but it never gets there. The deployment process stops with the message

    Updating 186 files to process still being displayed.


  • Taliesin*

    HI Jim,

    I had the environment broken too from the morning, this is the third time... What worked in last two times didnt help this time...But one thing for sure all the three times i did a "Delete All Breakpoints" from the VS2005 menu.

    I was trying trying and trying from the morning and had all active sync and other related things reinstalled, and even after that it didnt help.

    But then it started working suddenly... I dont know what i did to make it work...

    This thing is a real crazy thing that is happening with the Mobile devices, Is there a way this can be directly posted to the MS support group

    Thanks,

    Ragu...


  • Hemant Hindlekar

    As I've found in the past if I keep making changes then eventually this problem goes away as it just has done.

    I would love to know why this happens.


  • jimcjr

    Does anyone have any further information or experience with tackling this problem

    I have followed all the advice mentioned above and also still receive this dialog - very frustrating and time wasting.

    Occurs with both the Windows Mobile 5.0 SDK emulator and also on an O2 Windows Mobile 5.0 device.

    The application will however run successfully without VS2005 debugging. If I run the application first, then try to attach the VS2005 debugger, I receive the following error dialog: "Unable to attach to the process. Attach is not enabled for this process with this debug type."

    FYI, I have dependencies on:
    - SQL Server Everywhere CTP
    - OpenNETCF
    - Windows Mobile 5.0 SDK
    - Mobile Client Software Factory

    Thanks in advance.


  • Andy E

    I think there is a connection to break points as I've found that somtimes if I change the deployment configuration to release and then back to debug and then set a new breakpoint it sometimes springs back into life.


  • jerfoo

    I also tried putting a break point in the very first line of code, but it is never reached before the connection is lost. Even so, like I said before, if I comment out my call to a specific function, then I don't have this problem.

  • Chris.Stewart

    I recently ran into this problem again myself, so I tried what the previous post said. I deleted my break points, closed visual studio, reopened my project, added some break points, and ran it. It still loses the connection for me.

  • Martin Smith


    I've found an interesting pattern in this mystery...

    Any significant method invocation that occurs before the Forms application enters its Run loop (and hence message pump) will cause this behaviour.

    An example of such an invocation is the call to "SomeClass.DoSomething()" below:

    [MTAThread]
    static void Main()
    {
    SomeClass.DoSomething();

    Application.Run(new MyForm());
    }

    I have not been able to determine a pattern of what "significant" means in this case, i.e. whether only if calling a member of a type in another assembly (i.e. not the current executing assembly), or something else Nevertheless, I have been able to fix/unfix the "remote connection to the device has been lost" dialog problem simply by including/excluding such a line from my app's Main.

    This may also apply where a static constructor runs before Main is executed, but I haven't tested this scenario.

    Would be interested if this situation draws any similarity to others experiencing this problem. Eliminate all your startup code (statics included) from before Application.Run and see if it makes any difference...


  • Visual Studio 2005 The remote connection to the device has been lost. Please verify the device connection and restart debugg