Bug 18468 - Frequent 'Debugger Connection Lost'
Summary: Frequent 'Debugger Connection Lost'
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 1.12.x
Hardware: PC Mac OS
: High major
Target Milestone: 4.0.0 (C6)
Assignee: vsx
Depends on:
Reported: 2014-03-19 13:01 UTC by Timothy Risi
Modified: 2016-05-10 17:04 UTC (History)
13 users (show)

Is this bug a regression?: ---
Last known good build:

Zip Xamarin Logs (752.30 KB, application/octet-stream)
2015-07-16 11:38 UTC, Atin

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Timothy Risi 2014-03-19 13:01:21 UTC
Happens fairly frequently when trying to debug on the simulator.  Simulator launches, then error appears in the list "Debugger Connection Lost" and debugging stops.  Hitting the start button to start debugging again will relaunch the app and work fine.

Windows 8.1
XIVS 1.12.239
Comment 1 Sadik Ali 2014-03-20 04:23:43 UTC
I have checked this issue and not able to reproduce.

Followed below steps:

1. Created iOS project in VS.
2. debug application successfully.

I have checked on both VS 2013 and VS 2012

Refer screen cast: http://screencast.com/t/H4U1BJvTO

Version Info:

Window 8.1
VS 2012, 2013

Could you please re-recheck this again. Also if you are still encountering this
problem please assign back with following details

1. IDE log: Location: XS->Help->Open Log Directory->IDE.log 
2. Screen shot
Comment 3 Timothy Risi 2014-03-31 14:05:47 UTC
I've been unable to reproduce the issue since updating to XIVS 1.12.249 and XIOS, so I'm closing the issue.  I'll reopen if it starts happening again.
Comment 4 Michael Ribbons 2015-04-16 19:31:11 UTC
I am seeing this quite a lot. Has been happening for the last year. Only posting now because it sometimes it seems to go away then comes back.

I always keep my Xam stuff up to date, here are current versions:

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

Xamarin   3.9.547.0 (20fd2f0)
Xamarin.Android (86274adfc6418b4c3a9d67734eb871163859b51c)
Xamarin.iOS (02a05754f85064ec222c8a1a975761debfe7122d)
Xamarin.iOS Unified Migration   1.0

I get this in Xamarin Log. Not sure if it's always like this as I don't always check it:

[17-Apr-2015 09:27:30] Got connection from Visual Studio (log)
[17-Apr-2015 09:27:30] Error: Error accepting log connection from Visual Studio
[17-Apr-2015 09:27:30] Exception: Exception type: System.ObjectDisposedException
The object was used after being disposed.
  at System.Net.Sockets.Socket.EndAccept (System.Byte[]& buffer, System.Int32& bytesTransferred, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.EndAccept (IAsyncResult result) [0x00000] in <filename unknown>:0 
  at Mtb.Server.Proxy.LogProxy.VS_IncomingOutput (IAsyncResult result) [0x00000] in <filename unknown>:0
Comment 5 Michael Ribbons 2015-06-17 01:10:54 UTC

Just got this again.

I'm glad to see that the bug has been reopened.

Have been working fine on ipad simulator all day, then got the problem straight away when trying to debug on real ipad mini.

I will attach screen dump and xamarin log file.
Comment 9 Atin 2015-07-16 11:37:27 UTC
I have checked this issue and able to reproduce above behavior given in comment 5. I am getting same behavior given in comment 8. I observe that If Xcode is lower than iOS (e.g Xcode 6.2 and iOS 8.4) then error occur. When  application display on device then I click on application to launch it manually then application crashes as soon as it launches.

Screencast: http://www.screencast.com/t/5QFF7zDkdb
Error: https://gist.github.com/Mohit-Kheterpal/d5d260f2e716f6c6ee25 
Build Output: https://gist.github.com/Mohit-Kheterpal/47d80c361bf4fdf96b73

Environment Info:

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

Xamarin   3.11.666.0 (ebae43a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration

Comment 10 Atin 2015-07-16 11:38:05 UTC
Created attachment 12072 [details]
Zip Xamarin Logs
Comment 12 Michael Ribbons 2015-07-19 19:06:07 UTC
Hi Atin,
You seem to have reproduced a different problem.

The hallmark of this problem is this message in the Xamarin log:

The object was used after being disposed.

and an error of Debugger connection lost.

Since switching from MVVMCross to Xamarin Forms I haven't seen the problem.

I wonder if it's something to do with the 17 second startup time limit on iOS, as there is quite a lot of debug output from MVVMCross if the debug trace writer has been implemented to output to Debug.
Comment 16 Alec Tucker 2015-07-31 00:57:33 UTC
I'm also getting this a lot. It can suddenly start with no code changes. I can be happily debugging when it kicks in, and then I can't debug again without rebooting everything and uninstalling the app from the device - and that doesn't always work.
Very frustrating.
Comment 20 PJ 2015-08-03 16:05:08 UTC
Ok, so I spent a bit of time talking to Atin to try to dig into this. It sounds like comment 18, comment 17, and comment 9 are describing the same issue, and that issue has been reported separately as bug 31753, (and the duplicate bug 31740). It does not result in a "Debugger Connection lost" error, and does not result in an ObjectDisposedException. 

Those behaviors are occurring when the user has an Xcode configured that does not support the iOS version being used. In Atin's case, he's using iOS 8.4 with Xcode 6.2. 

The reason he was responding with that test case is because it seems to match the error message in comment 8. I am not seeing the ObjectDisposedException in Atin's logs, however, so I suspect they are different bugs.

I think there are 4 issues in play here, and I don't think any of them are duplicates (currently). In order to achieve sanity, I want to separate them into different reports. 

Atin's issue is filed already, I filed Michael's issue, and I think we need a new bug report from Alec. Here is the overview of the issues:

- Original issue, reported by Tim and fixed early last year (bug 18468)
- ObjectDisposedException reported by Michael in comment 4. (Now filed as bug 32726)
- iOS 8.4 / Xcode 6.2 mismatch reported by Atin (bug 31740)
- Issue reported by Alec in comment 16 (Not yet filed).

Michael, can you take a look at bug 32726 and make sure I got the right info down?

Alec, can you open a new bug with full version information and logs, as well as a concise test case to help us track it down? That will be the best way to make sure we resolve and verify your specific issue as well. The report of having to uninstall the app and / or reboot means that it is not the same issue being discussed by Tim, Atin, or Michael. We may be able to see something else in your logs. 

This bug is going back to the RESOLVED state, as I believe the original issue was fixed back in early 2014 and newer issues with some similar characteristics are better tracked and addressed in separate bugs.
Comment 21 Saurabh 2015-08-04 02:17:56 UTC
As per Comment#3 and Comment#20, I am changing the status of this bug to VERIFIED